Average Error: 0.2 → 0.2
Time: 5.1s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{\sqrt[3]{1} \cdot \mathsf{fma}\left(\cos B, -x, 1\right)}{\sin B} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{\sqrt[3]{1} \cdot \mathsf{fma}\left(\cos B, -x, 1\right)}{\sin B} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)
double code(double B, double x) {
	return (-(x * (1.0 / tan(B))) + (1.0 / sin(B)));
}
double code(double B, double x) {
	return (((cbrt(1.0) * fma(cos(B), -x, 1.0)) / sin(B)) * (cbrt(1.0) * cbrt(1.0)));
}

Error

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\color{blue}{\frac{\sin B}{\cos B}}}, \frac{1}{\sin B}\right)\]
  5. Applied associate-/r/0.2

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

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  7. Simplified0.3

    \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(\cos B \cdot \left(-x\right) + 1\right)}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.3

    \[\leadsto \frac{1}{\color{blue}{1 \cdot \sin B}} \cdot \left(\cos B \cdot \left(-x\right) + 1\right)\]
  10. Applied add-cube-cbrt0.3

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{1 \cdot \sin B} \cdot \left(\cos B \cdot \left(-x\right) + 1\right)\]
  11. Applied times-frac0.3

    \[\leadsto \color{blue}{\left(\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\sqrt[3]{1}}{\sin B}\right)} \cdot \left(\cos B \cdot \left(-x\right) + 1\right)\]
  12. Applied associate-*l*0.3

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \left(\frac{\sqrt[3]{1}}{\sin B} \cdot \left(\cos B \cdot \left(-x\right) + 1\right)\right)}\]
  13. Simplified0.2

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

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

Reproduce

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