Average Error: 0.2 → 0.2
Time: 5.1s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}
double f(double B, double x) {
        double r34079 = x;
        double r34080 = 1.0;
        double r34081 = B;
        double r34082 = tan(r34081);
        double r34083 = r34080 / r34082;
        double r34084 = r34079 * r34083;
        double r34085 = -r34084;
        double r34086 = sin(r34081);
        double r34087 = r34080 / r34086;
        double r34088 = r34085 + r34087;
        return r34088;
}

double f(double B, double x) {
        double r34089 = 1.0;
        double r34090 = B;
        double r34091 = sin(r34090);
        double r34092 = r34089 / r34091;
        double r34093 = x;
        double r34094 = r34093 * r34089;
        double r34095 = tan(r34090);
        double r34096 = r34094 / r34095;
        double r34097 = r34092 - r34096;
        return r34097;
}

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. Using strategy rm
  3. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{\sin B}\]
  4. Using strategy rm
  5. Applied clear-num0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.2

    \[\leadsto \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{1}{\color{blue}{1 \cdot \sin B}}\]
  8. Applied *-un-lft-identity0.2

    \[\leadsto \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{\color{blue}{1 \cdot 1}}{1 \cdot \sin B}\]
  9. Applied times-frac0.2

    \[\leadsto \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \color{blue}{\frac{1}{1} \cdot \frac{1}{\sin B}}\]
  10. Applied *-un-lft-identity0.2

    \[\leadsto \left(-\frac{1}{\color{blue}{1 \cdot \frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{1} \cdot \frac{1}{\sin B}\]
  11. Applied *-un-lft-identity0.2

    \[\leadsto \left(-\frac{\color{blue}{1 \cdot 1}}{1 \cdot \frac{\tan B}{x \cdot 1}}\right) + \frac{1}{1} \cdot \frac{1}{\sin B}\]
  12. Applied times-frac0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{1} \cdot \frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{1} \cdot \frac{1}{\sin B}\]
  13. Applied distribute-rgt-neg-in0.2

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right)} + \frac{1}{1} \cdot \frac{1}{\sin B}\]
  14. Applied distribute-lft-out0.2

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \left(\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{1}{\sin B}\right)}\]
  15. Simplified0.2

    \[\leadsto \frac{1}{1} \cdot \color{blue}{\left(\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\right)}\]
  16. Final simplification0.2

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

Reproduce

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