Average Error: 4.1 → 0.2
Time: 9.8s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
double f(double kx, double ky, double th) {
        double r33686 = ky;
        double r33687 = sin(r33686);
        double r33688 = kx;
        double r33689 = sin(r33688);
        double r33690 = 2.0;
        double r33691 = pow(r33689, r33690);
        double r33692 = pow(r33687, r33690);
        double r33693 = r33691 + r33692;
        double r33694 = sqrt(r33693);
        double r33695 = r33687 / r33694;
        double r33696 = th;
        double r33697 = sin(r33696);
        double r33698 = r33695 * r33697;
        return r33698;
}

double f(double kx, double ky, double th) {
        double r33699 = th;
        double r33700 = sin(r33699);
        double r33701 = ky;
        double r33702 = sin(r33701);
        double r33703 = kx;
        double r33704 = sin(r33703);
        double r33705 = hypot(r33702, r33704);
        double r33706 = r33705 / r33702;
        double r33707 = r33700 / r33706;
        return r33707;
}

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 *-commutative0.2

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

    \[\leadsto \sin th \cdot \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.3

    \[\leadsto \color{blue}{\left(1 \cdot \sin th\right)} \cdot \frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\]
  10. Applied associate-*l*0.3

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

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

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

Reproduce

herbie shell --seed 2020062 +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)))