Average Error: 13.5 → 10.5
Time: 38.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 r796325 = x;
        double r796326 = 1.0;
        double r796327 = B;
        double r796328 = tan(r796327);
        double r796329 = r796326 / r796328;
        double r796330 = r796325 * r796329;
        double r796331 = -r796330;
        double r796332 = F;
        double r796333 = sin(r796327);
        double r796334 = r796332 / r796333;
        double r796335 = r796332 * r796332;
        double r796336 = 2.0;
        double r796337 = r796335 + r796336;
        double r796338 = r796336 * r796325;
        double r796339 = r796337 + r796338;
        double r796340 = r796326 / r796336;
        double r796341 = -r796340;
        double r796342 = pow(r796339, r796341);
        double r796343 = r796334 * r796342;
        double r796344 = r796331 + r796343;
        return r796344;
}

double f(double F, double B, double x) {
        double r796345 = 1.0;
        double r796346 = B;
        double r796347 = sin(r796346);
        double r796348 = x;
        double r796349 = 2.0;
        double r796350 = F;
        double r796351 = fma(r796350, r796350, r796349);
        double r796352 = fma(r796348, r796349, r796351);
        double r796353 = -0.5;
        double r796354 = pow(r796352, r796353);
        double r796355 = r796354 * r796350;
        double r796356 = expm1(r796355);
        double r796357 = log1p(r796356);
        double r796358 = r796347 / r796357;
        double r796359 = r796345 / r796358;
        double r796360 = tan(r796346);
        double r796361 = r796348 / r796360;
        double r796362 = r796359 - r796361;
        return r796362;
}

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))))))