Average Error: 0.2 → 0.2
Time: 28.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{\frac{\tan B}{\sin B} - x}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{\frac{\tan B}{\sin B} - x}{\tan B}
double f(double B, double x) {
        double r668684 = x;
        double r668685 = 1.0;
        double r668686 = B;
        double r668687 = tan(r668686);
        double r668688 = r668685 / r668687;
        double r668689 = r668684 * r668688;
        double r668690 = -r668689;
        double r668691 = sin(r668686);
        double r668692 = r668685 / r668691;
        double r668693 = r668690 + r668692;
        return r668693;
}

double f(double B, double x) {
        double r668694 = B;
        double r668695 = tan(r668694);
        double r668696 = sin(r668694);
        double r668697 = r668695 / r668696;
        double r668698 = x;
        double r668699 = r668697 - r668698;
        double r668700 = r668699 / r668695;
        return r668700;
}

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 frac-sub10.4

    \[\leadsto \color{blue}{\frac{1 \cdot \tan B - \sin B \cdot x}{\sin B \cdot \tan B}}\]
  5. Simplified10.4

    \[\leadsto \frac{\color{blue}{\tan B - \sin B \cdot x}}{\sin B \cdot \tan B}\]
  6. Using strategy rm
  7. Applied associate-/r*0.2

    \[\leadsto \color{blue}{\frac{\frac{\tan B - \sin B \cdot x}{\sin B}}{\tan B}}\]
  8. Simplified0.2

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

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

Reproduce

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