Average Error: 0.2 → 0.2
Time: 14.2s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1 \cdot \frac{1}{\sqrt{1}} - \left(\sin B \cdot \frac{\sqrt{1} \cdot x}{\sin B}\right) \cdot \cos B}{\frac{\sin B}{\sqrt{1}}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1 \cdot \frac{1}{\sqrt{1}} - \left(\sin B \cdot \frac{\sqrt{1} \cdot x}{\sin B}\right) \cdot \cos B}{\frac{\sin B}{\sqrt{1}}}
double code(double B, double x) {
	return ((double) (((double) -(((double) (x * ((double) (1.0 / ((double) tan(B)))))))) + ((double) (1.0 / ((double) sin(B))))));
}
double code(double B, double x) {
	return ((double) (((double) (((double) (1.0 * ((double) (1.0 / ((double) sqrt(1.0)))))) - ((double) (((double) (((double) sin(B)) * ((double) (((double) (((double) sqrt(1.0)) * x)) / ((double) sin(B)))))) * ((double) cos(B)))))) / ((double) (((double) sin(B)) / ((double) sqrt(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}{\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.2

    \[\leadsto \frac{1}{\sin B} - x \cdot \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{\tan B}\]
  5. Applied associate-/l*0.2

    \[\leadsto \frac{1}{\sin B} - x \cdot \color{blue}{\frac{\sqrt{1}}{\frac{\tan B}{\sqrt{1}}}}\]
  6. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot \sqrt{1}}{\frac{\tan B}{\sqrt{1}}}}\]
  7. Simplified0.2

    \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\sqrt{1} \cdot x}}{\frac{\tan B}{\sqrt{1}}}\]
  8. Using strategy rm
  9. Applied div-inv0.2

    \[\leadsto \frac{1}{\sin B} - \frac{\sqrt{1} \cdot x}{\color{blue}{\tan B \cdot \frac{1}{\sqrt{1}}}}\]
  10. Applied associate-/r*0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\frac{\sqrt{1} \cdot x}{\tan B}}{\frac{1}{\sqrt{1}}}}\]
  11. Applied frac-sub0.2

    \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{\sqrt{1}} - \sin B \cdot \frac{\sqrt{1} \cdot x}{\tan B}}{\sin B \cdot \frac{1}{\sqrt{1}}}}\]
  12. Simplified0.2

    \[\leadsto \frac{1 \cdot \frac{1}{\sqrt{1}} - \sin B \cdot \frac{\sqrt{1} \cdot x}{\tan B}}{\color{blue}{\frac{\sin B}{\sqrt{1}}}}\]
  13. Using strategy rm
  14. Applied tan-quot0.2

    \[\leadsto \frac{1 \cdot \frac{1}{\sqrt{1}} - \sin B \cdot \frac{\sqrt{1} \cdot x}{\color{blue}{\frac{\sin B}{\cos B}}}}{\frac{\sin B}{\sqrt{1}}}\]
  15. Applied associate-/r/0.2

    \[\leadsto \frac{1 \cdot \frac{1}{\sqrt{1}} - \sin B \cdot \color{blue}{\left(\frac{\sqrt{1} \cdot x}{\sin B} \cdot \cos B\right)}}{\frac{\sin B}{\sqrt{1}}}\]
  16. Applied associate-*r*0.2

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

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

Reproduce

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