Average Error: 13.5 → 10.5
Time: 34.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)}\]
\[\frac{1}{\frac{\sin B}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)}} - \frac{x}{\tan B}\]
\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)}
\frac{1}{\frac{\sin B}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)}} - \frac{x}{\tan B}
double f(double F, double B, double x) {
        double r782090 = x;
        double r782091 = 1.0;
        double r782092 = B;
        double r782093 = tan(r782092);
        double r782094 = r782091 / r782093;
        double r782095 = r782090 * r782094;
        double r782096 = -r782095;
        double r782097 = F;
        double r782098 = sin(r782092);
        double r782099 = r782097 / r782098;
        double r782100 = r782097 * r782097;
        double r782101 = 2.0;
        double r782102 = r782100 + r782101;
        double r782103 = r782101 * r782090;
        double r782104 = r782102 + r782103;
        double r782105 = r782091 / r782101;
        double r782106 = -r782105;
        double r782107 = pow(r782104, r782106);
        double r782108 = r782099 * r782107;
        double r782109 = r782096 + r782108;
        return r782109;
}

double f(double F, double B, double x) {
        double r782110 = 1.0;
        double r782111 = B;
        double r782112 = sin(r782111);
        double r782113 = x;
        double r782114 = 2.0;
        double r782115 = F;
        double r782116 = fma(r782115, r782115, r782114);
        double r782117 = fma(r782113, r782114, r782116);
        double r782118 = -0.5;
        double r782119 = pow(r782117, r782118);
        double r782120 = r782119 * r782115;
        double r782121 = expm1(r782120);
        double r782122 = log1p(r782121);
        double r782123 = r782112 / r782122;
        double r782124 = r782110 / r782123;
        double r782125 = tan(r782111);
        double r782126 = r782113 / r782125;
        double r782127 = r782124 - r782126;
        return r782127;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.5

    \[\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}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-*r/10.5

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

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

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

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

Reproduce

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