Average Error: 14.0 → 13.9
Time: 36.8s
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({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{-\frac{1}{2}}{2}\right)} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{-\frac{1}{2}}{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({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{-\frac{1}{2}}{2}\right)} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\frac{-\frac{1}{2}}{2}\right)}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)
double f(double F, double B, double x) {
        double r55475 = x;
        double r55476 = 1.0;
        double r55477 = B;
        double r55478 = tan(r55477);
        double r55479 = r55476 / r55478;
        double r55480 = r55475 * r55479;
        double r55481 = -r55480;
        double r55482 = F;
        double r55483 = sin(r55477);
        double r55484 = r55482 / r55483;
        double r55485 = r55482 * r55482;
        double r55486 = 2.0;
        double r55487 = r55485 + r55486;
        double r55488 = r55486 * r55475;
        double r55489 = r55487 + r55488;
        double r55490 = r55476 / r55486;
        double r55491 = -r55490;
        double r55492 = pow(r55489, r55491);
        double r55493 = r55484 * r55492;
        double r55494 = r55481 + r55493;
        return r55494;
}

double f(double F, double B, double x) {
        double r55495 = 2.0;
        double r55496 = x;
        double r55497 = F;
        double r55498 = fma(r55497, r55497, r55495);
        double r55499 = fma(r55495, r55496, r55498);
        double r55500 = 1.0;
        double r55501 = r55500 / r55495;
        double r55502 = -r55501;
        double r55503 = 2.0;
        double r55504 = r55502 / r55503;
        double r55505 = pow(r55499, r55504);
        double r55506 = r55505 * r55505;
        double r55507 = 1.0;
        double r55508 = B;
        double r55509 = sin(r55508);
        double r55510 = r55507 / r55509;
        double r55511 = r55497 * r55510;
        double r55512 = r55496 * r55500;
        double r55513 = tan(r55508);
        double r55514 = r55512 / r55513;
        double r55515 = -r55514;
        double r55516 = fma(r55506, r55511, r55515);
        return r55516;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 14.0

    \[\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.9

    \[\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.9

    \[\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.9

    \[\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 sqr-pow13.9

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

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

Reproduce

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