Average Error: 13.4 → 13.3
Time: 48.2s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
\[\mathsf{fma}\left(\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\mathsf{fma}\left(\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)
double f(double F, double B, double x) {
        double r64392 = x;
        double r64393 = 1.0;
        double r64394 = B;
        double r64395 = tan(r64394);
        double r64396 = r64393 / r64395;
        double r64397 = r64392 * r64396;
        double r64398 = -r64397;
        double r64399 = F;
        double r64400 = sin(r64394);
        double r64401 = r64399 / r64400;
        double r64402 = r64399 * r64399;
        double r64403 = 2.0;
        double r64404 = r64402 + r64403;
        double r64405 = r64403 * r64392;
        double r64406 = r64404 + r64405;
        double r64407 = r64393 / r64403;
        double r64408 = -r64407;
        double r64409 = pow(r64406, r64408);
        double r64410 = r64401 * r64409;
        double r64411 = r64398 + r64410;
        return r64411;
}

double f(double F, double B, double x) {
        double r64412 = 1.0;
        double r64413 = 2.0;
        double r64414 = x;
        double r64415 = F;
        double r64416 = fma(r64415, r64415, r64413);
        double r64417 = fma(r64413, r64414, r64416);
        double r64418 = 1.0;
        double r64419 = r64418 / r64413;
        double r64420 = pow(r64417, r64419);
        double r64421 = r64412 / r64420;
        double r64422 = B;
        double r64423 = sin(r64422);
        double r64424 = r64412 / r64423;
        double r64425 = r64415 * r64424;
        double r64426 = r64414 * r64418;
        double r64427 = tan(r64422);
        double r64428 = r64426 / r64427;
        double r64429 = -r64428;
        double r64430 = fma(r64421, r64425, r64429);
        return r64430;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.4

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
  2. Simplified13.4

    \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)}\]
  3. Using strategy rm
  4. Applied associate-*r/13.3

    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\]
  5. Using strategy rm
  6. Applied div-inv13.3

    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{1}{2}\right)}, \color{blue}{F \cdot \frac{1}{\sin B}}, -\frac{x \cdot 1}{\tan B}\right)\]
  7. Using strategy rm
  8. Applied pow-neg13.3

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  9. Final simplification13.3

    \[\leadsto \mathsf{fma}\left(\frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{1}{2}\right)}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]

Reproduce

herbie shell --seed 2019199 +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))