Average Error: 14.1 → 11.7
Time: 42.4s
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{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \frac{\frac{x}{\sqrt[3]{\sin B}}}{\sqrt[3]{\sin B}} \cdot \frac{\cos B}{\sqrt[3]{\sin 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{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \frac{\frac{x}{\sqrt[3]{\sin B}}}{\sqrt[3]{\sin B}} \cdot \frac{\cos B}{\sqrt[3]{\sin B}}
double f(double F, double B, double x) {
        double r1842193 = x;
        double r1842194 = 1.0;
        double r1842195 = B;
        double r1842196 = tan(r1842195);
        double r1842197 = r1842194 / r1842196;
        double r1842198 = r1842193 * r1842197;
        double r1842199 = -r1842198;
        double r1842200 = F;
        double r1842201 = sin(r1842195);
        double r1842202 = r1842200 / r1842201;
        double r1842203 = r1842200 * r1842200;
        double r1842204 = 2.0;
        double r1842205 = r1842203 + r1842204;
        double r1842206 = r1842204 * r1842193;
        double r1842207 = r1842205 + r1842206;
        double r1842208 = r1842194 / r1842204;
        double r1842209 = -r1842208;
        double r1842210 = pow(r1842207, r1842209);
        double r1842211 = r1842202 * r1842210;
        double r1842212 = r1842199 + r1842211;
        return r1842212;
}

double f(double F, double B, double x) {
        double r1842213 = 2.0;
        double r1842214 = x;
        double r1842215 = F;
        double r1842216 = fma(r1842215, r1842215, r1842213);
        double r1842217 = fma(r1842213, r1842214, r1842216);
        double r1842218 = -0.5;
        double r1842219 = pow(r1842217, r1842218);
        double r1842220 = r1842219 * r1842215;
        double r1842221 = B;
        double r1842222 = sin(r1842221);
        double r1842223 = r1842220 / r1842222;
        double r1842224 = cbrt(r1842222);
        double r1842225 = r1842214 / r1842224;
        double r1842226 = r1842225 / r1842224;
        double r1842227 = cos(r1842221);
        double r1842228 = r1842227 / r1842224;
        double r1842229 = r1842226 * r1842228;
        double r1842230 = r1842223 - r1842229;
        return r1842230;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 14.1

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

    \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(2, x, \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/11.1

    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B}} - \frac{x}{\tan B}\]
  5. Taylor expanded around -inf 11.1

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity11.1

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \frac{x \cdot \cos B}{\color{blue}{1 \cdot \sin B}}\]
  8. Applied times-frac11.2

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

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{x} \cdot \frac{\cos B}{\sin B}\]
  10. Using strategy rm
  11. Applied add-cube-cbrt11.7

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - x \cdot \frac{\cos B}{\color{blue}{\left(\sqrt[3]{\sin B} \cdot \sqrt[3]{\sin B}\right) \cdot \sqrt[3]{\sin B}}}\]
  12. Applied *-un-lft-identity11.7

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - x \cdot \frac{\color{blue}{1 \cdot \cos B}}{\left(\sqrt[3]{\sin B} \cdot \sqrt[3]{\sin B}\right) \cdot \sqrt[3]{\sin B}}\]
  13. Applied times-frac11.7

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - x \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{\sin B} \cdot \sqrt[3]{\sin B}} \cdot \frac{\cos B}{\sqrt[3]{\sin B}}\right)}\]
  14. Applied associate-*r*11.7

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{\left(x \cdot \frac{1}{\sqrt[3]{\sin B} \cdot \sqrt[3]{\sin B}}\right) \cdot \frac{\cos B}{\sqrt[3]{\sin B}}}\]
  15. Simplified11.7

    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} - \color{blue}{\frac{\frac{x}{\sqrt[3]{\sin B}}}{\sqrt[3]{\sin B}}} \cdot \frac{\cos B}{\sqrt[3]{\sin B}}\]
  16. Final simplification11.7

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

Reproduce

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