Average Error: 13.2 → 10.5
Time: 38.1s
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{\mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left({\left(\mathsf{fma}\left(2, x, \left(\mathsf{fma}\left(F, F, 2\right)\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)\right)\right)}{\sin B} - \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{\mathsf{log1p}\left(\left(\mathsf{expm1}\left(\left({\left(\mathsf{fma}\left(2, x, \left(\mathsf{fma}\left(F, F, 2\right)\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right)\right)\right)\right)}{\sin B} - \frac{x}{\tan B}
double f(double F, double B, double x) {
        double r1523915 = x;
        double r1523916 = 1.0;
        double r1523917 = B;
        double r1523918 = tan(r1523917);
        double r1523919 = r1523916 / r1523918;
        double r1523920 = r1523915 * r1523919;
        double r1523921 = -r1523920;
        double r1523922 = F;
        double r1523923 = sin(r1523917);
        double r1523924 = r1523922 / r1523923;
        double r1523925 = r1523922 * r1523922;
        double r1523926 = 2.0;
        double r1523927 = r1523925 + r1523926;
        double r1523928 = r1523926 * r1523915;
        double r1523929 = r1523927 + r1523928;
        double r1523930 = r1523916 / r1523926;
        double r1523931 = -r1523930;
        double r1523932 = pow(r1523929, r1523931);
        double r1523933 = r1523924 * r1523932;
        double r1523934 = r1523921 + r1523933;
        return r1523934;
}

double f(double F, double B, double x) {
        double r1523935 = 2.0;
        double r1523936 = x;
        double r1523937 = F;
        double r1523938 = fma(r1523937, r1523937, r1523935);
        double r1523939 = fma(r1523935, r1523936, r1523938);
        double r1523940 = -0.5;
        double r1523941 = pow(r1523939, r1523940);
        double r1523942 = r1523941 * r1523937;
        double r1523943 = expm1(r1523942);
        double r1523944 = log1p(r1523943);
        double r1523945 = B;
        double r1523946 = sin(r1523945);
        double r1523947 = r1523944 / r1523946;
        double r1523948 = tan(r1523945);
        double r1523949 = r1523936 / r1523948;
        double r1523950 = r1523947 - r1523949;
        return r1523950;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.2

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

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

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

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

Reproduce

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