Average Error: 13.7 → 13.6
Time: 40.3s
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({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\sqrt{1}\right)}\right)}^{\left(\frac{\sqrt{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({\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\sqrt{1}\right)}\right)}^{\left(\frac{\sqrt{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 r64535 = x;
        double r64536 = 1.0;
        double r64537 = B;
        double r64538 = tan(r64537);
        double r64539 = r64536 / r64538;
        double r64540 = r64535 * r64539;
        double r64541 = -r64540;
        double r64542 = F;
        double r64543 = sin(r64537);
        double r64544 = r64542 / r64543;
        double r64545 = r64542 * r64542;
        double r64546 = 2.0;
        double r64547 = r64545 + r64546;
        double r64548 = r64546 * r64535;
        double r64549 = r64547 + r64548;
        double r64550 = r64536 / r64546;
        double r64551 = -r64550;
        double r64552 = pow(r64549, r64551);
        double r64553 = r64544 * r64552;
        double r64554 = r64541 + r64553;
        return r64554;
}

double f(double F, double B, double x) {
        double r64555 = 2.0;
        double r64556 = x;
        double r64557 = F;
        double r64558 = fma(r64557, r64557, r64555);
        double r64559 = fma(r64555, r64556, r64558);
        double r64560 = 1.0;
        double r64561 = sqrt(r64560);
        double r64562 = -r64561;
        double r64563 = pow(r64559, r64562);
        double r64564 = r64561 / r64555;
        double r64565 = pow(r64563, r64564);
        double r64566 = 1.0;
        double r64567 = B;
        double r64568 = sin(r64567);
        double r64569 = r64566 / r64568;
        double r64570 = r64557 * r64569;
        double r64571 = r64556 * r64560;
        double r64572 = tan(r64567);
        double r64573 = r64571 / r64572;
        double r64574 = -r64573;
        double r64575 = fma(r64565, r64570, r64574);
        return r64575;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.7

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

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

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

    \[\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 *-un-lft-identity13.6

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

    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{1 \cdot 2}\right)}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  10. Applied times-frac13.6

    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{\frac{\sqrt{1}}{1} \cdot \frac{\sqrt{1}}{2}}\right)}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  11. Applied distribute-lft-neg-in13.6

    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{\left(\left(-\frac{\sqrt{1}}{1}\right) \cdot \frac{\sqrt{1}}{2}\right)}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  12. Applied pow-unpow13.6

    \[\leadsto \mathsf{fma}\left(\color{blue}{{\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\frac{\sqrt{1}}{1}\right)}\right)}^{\left(\frac{\sqrt{1}}{2}\right)}}, F \cdot \frac{1}{\sin B}, -\frac{x \cdot 1}{\tan B}\right)\]
  13. Simplified13.6

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

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

Reproduce

herbie shell --seed 2019325 +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))))))