Average Error: 0.2 → 0.3
Time: 22.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \left(\left(x \cdot \cos B\right) \cdot \frac{1}{\sin B}\right) \cdot 1\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \left(\left(x \cdot \cos B\right) \cdot \frac{1}{\sin B}\right) \cdot 1
double f(double B, double x) {
        double r835535 = x;
        double r835536 = 1.0;
        double r835537 = B;
        double r835538 = tan(r835537);
        double r835539 = r835536 / r835538;
        double r835540 = r835535 * r835539;
        double r835541 = -r835540;
        double r835542 = sin(r835537);
        double r835543 = r835536 / r835542;
        double r835544 = r835541 + r835543;
        return r835544;
}

double f(double B, double x) {
        double r835545 = 1.0;
        double r835546 = B;
        double r835547 = sin(r835546);
        double r835548 = r835545 / r835547;
        double r835549 = x;
        double r835550 = cos(r835546);
        double r835551 = r835549 * r835550;
        double r835552 = 1.0;
        double r835553 = r835552 / r835547;
        double r835554 = r835551 * r835553;
        double r835555 = r835554 * r835545;
        double r835556 = r835548 - r835555;
        return r835556;
}

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. Taylor expanded around inf 0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  4. Using strategy rm
  5. Applied div-inv0.3

    \[\leadsto \frac{1}{\sin B} - 1 \cdot \color{blue}{\left(\left(x \cdot \cos B\right) \cdot \frac{1}{\sin B}\right)}\]
  6. Final simplification0.3

    \[\leadsto \frac{1}{\sin B} - \left(\left(x \cdot \cos B\right) \cdot \frac{1}{\sin B}\right) \cdot 1\]

Reproduce

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