Average Error: 0.2 → 0.3
Time: 7.0s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\mathsf{fma}\left(-x, 1 \cdot \frac{{\left({\left(\cos B\right)}^{2}\right)}^{\frac{1}{3}}}{\frac{\sin B}{\sqrt[3]{\cos B}}}, \frac{1}{\sin B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\mathsf{fma}\left(-x, 1 \cdot \frac{{\left({\left(\cos B\right)}^{2}\right)}^{\frac{1}{3}}}{\frac{\sin B}{\sqrt[3]{\cos B}}}, \frac{1}{\sin B}\right)
double f(double B, double x) {
        double r18725 = x;
        double r18726 = 1.0;
        double r18727 = B;
        double r18728 = tan(r18727);
        double r18729 = r18726 / r18728;
        double r18730 = r18725 * r18729;
        double r18731 = -r18730;
        double r18732 = sin(r18727);
        double r18733 = r18726 / r18732;
        double r18734 = r18731 + r18733;
        return r18734;
}

double f(double B, double x) {
        double r18735 = x;
        double r18736 = -r18735;
        double r18737 = 1.0;
        double r18738 = B;
        double r18739 = cos(r18738);
        double r18740 = 2.0;
        double r18741 = pow(r18739, r18740);
        double r18742 = 0.3333333333333333;
        double r18743 = pow(r18741, r18742);
        double r18744 = sin(r18738);
        double r18745 = cbrt(r18739);
        double r18746 = r18744 / r18745;
        double r18747 = r18743 / r18746;
        double r18748 = r18737 * r18747;
        double r18749 = r18737 / r18744;
        double r18750 = fma(r18736, r18748, r18749);
        return r18750;
}

Error

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 0.2

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{1}{\sin B}\right)}\]
  3. Taylor expanded around inf 0.2

    \[\leadsto \mathsf{fma}\left(-x, \color{blue}{1 \cdot \frac{\cos B}{\sin B}}, \frac{1}{\sin B}\right)\]
  4. Using strategy rm
  5. Applied add-cube-cbrt0.5

    \[\leadsto \mathsf{fma}\left(-x, 1 \cdot \frac{\color{blue}{\left(\sqrt[3]{\cos B} \cdot \sqrt[3]{\cos B}\right) \cdot \sqrt[3]{\cos B}}}{\sin B}, \frac{1}{\sin B}\right)\]
  6. Applied associate-/l*0.5

    \[\leadsto \mathsf{fma}\left(-x, 1 \cdot \color{blue}{\frac{\sqrt[3]{\cos B} \cdot \sqrt[3]{\cos B}}{\frac{\sin B}{\sqrt[3]{\cos B}}}}, \frac{1}{\sin B}\right)\]
  7. Using strategy rm
  8. Applied pow1/318.4

    \[\leadsto \mathsf{fma}\left(-x, 1 \cdot \frac{\sqrt[3]{\cos B} \cdot \color{blue}{{\left(\cos B\right)}^{\frac{1}{3}}}}{\frac{\sin B}{\sqrt[3]{\cos B}}}, \frac{1}{\sin B}\right)\]
  9. Applied pow1/318.4

    \[\leadsto \mathsf{fma}\left(-x, 1 \cdot \frac{\color{blue}{{\left(\cos B\right)}^{\frac{1}{3}}} \cdot {\left(\cos B\right)}^{\frac{1}{3}}}{\frac{\sin B}{\sqrt[3]{\cos B}}}, \frac{1}{\sin B}\right)\]
  10. Applied pow-prod-down0.3

    \[\leadsto \mathsf{fma}\left(-x, 1 \cdot \frac{\color{blue}{{\left(\cos B \cdot \cos B\right)}^{\frac{1}{3}}}}{\frac{\sin B}{\sqrt[3]{\cos B}}}, \frac{1}{\sin B}\right)\]
  11. Simplified0.3

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

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

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))