Average Error: 4.1 → 0.3
Time: 11.0s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin th}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin th}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}
double code(double kx, double ky, double th) {
	return ((double) (((double) (((double) sin(ky)) / ((double) sqrt(((double) (((double) pow(((double) sin(kx)), 2.0)) + ((double) pow(((double) sin(ky)), 2.0)))))))) * ((double) sin(th))));
}
double code(double kx, double ky, double th) {
	return ((double) (((double) sin(th)) / ((double) (1.0 / ((double) (((double) sin(ky)) / ((double) hypot(((double) sin(ky)), ((double) sin(kx))))))))));
}

Error

Bits error versus kx

Bits error versus ky

Bits error versus th

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 4.1

    \[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
  2. Taylor expanded around inf 4.1

    \[\leadsto \frac{\sin ky}{\color{blue}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}}} \cdot \sin th\]
  3. Simplified0.2

    \[\leadsto \frac{\sin ky}{\color{blue}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \sin th\]
  4. Using strategy rm
  5. Applied clear-num0.3

    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}} \cdot \sin th\]
  6. Using strategy rm
  7. Applied associate-*l/0.2

    \[\leadsto \color{blue}{\frac{1 \cdot \sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}}\]
  8. Simplified0.2

    \[\leadsto \frac{\color{blue}{\sin th}}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\]
  9. Using strategy rm
  10. Applied clear-num0.3

    \[\leadsto \frac{\sin th}{\color{blue}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}}\]
  11. Final simplification0.3

    \[\leadsto \frac{\sin th}{\frac{1}{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]

Reproduce

herbie shell --seed 2020123 +o rules:numerics
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  :precision binary64
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))