Average Error: 0.2 → 0.2
Time: 7.8s
Precision: binary64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]
\[\frac{1}{\sin B} - \frac{x}{\tan B} \]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\tan B}
(FPCore (B x)
 :precision binary64
 (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
(FPCore (B x) :precision binary64 (- (/ 1.0 (sin B)) (/ x (tan B))))
double code(double B, double x) {
	return -(x * (1.0 / tan(B))) + (1.0 / sin(B));
}
double code(double B, double x) {
	return (1.0 / sin(B)) - (x / tan(B));
}

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}{\frac{1}{\sin B} - \frac{x}{\tan B}} \]
  3. Applied add-cube-cbrt_binary640.6

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\left(\sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}\right) \cdot \sqrt[3]{\frac{x}{\tan B}}} \]
  4. Applied add-cube-cbrt_binary641.3

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{1}{\sin B}} \cdot \sqrt[3]{\frac{1}{\sin B}}\right) \cdot \sqrt[3]{\frac{1}{\sin B}}} - \left(\sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}\right) \cdot \sqrt[3]{\frac{x}{\tan B}} \]
  5. Applied prod-diff_binary641.3

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{1}{\sin B}} \cdot \sqrt[3]{\frac{1}{\sin B}}, \sqrt[3]{\frac{1}{\sin B}}, -\sqrt[3]{\frac{x}{\tan B}} \cdot \left(\sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\frac{x}{\tan B}}, \sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}, \sqrt[3]{\frac{x}{\tan B}} \cdot \left(\sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}\right)\right)} \]
  6. Simplified0.2

    \[\leadsto \color{blue}{\left(\frac{1}{\sin B} - \frac{x}{\tan B}\right)} + \mathsf{fma}\left(-\sqrt[3]{\frac{x}{\tan B}}, \sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}, \sqrt[3]{\frac{x}{\tan B}} \cdot \left(\sqrt[3]{\frac{x}{\tan B}} \cdot \sqrt[3]{\frac{x}{\tan B}}\right)\right) \]
  7. Simplified0.2

    \[\leadsto \left(\frac{1}{\sin B} - \frac{x}{\tan B}\right) + \color{blue}{0} \]
  8. Final simplification0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\tan B} \]

Reproduce

herbie shell --seed 2021291 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))