Average Error: 13.1 → 9.3
Time: 37.2s
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 f(double kx, double ky, double th) {
        double r1138714 = ky;
        double r1138715 = sin(r1138714);
        double r1138716 = kx;
        double r1138717 = sin(r1138716);
        double r1138718 = 2.0;
        double r1138719 = pow(r1138717, r1138718);
        double r1138720 = pow(r1138715, r1138718);
        double r1138721 = r1138719 + r1138720;
        double r1138722 = sqrt(r1138721);
        double r1138723 = r1138715 / r1138722;
        double r1138724 = th;
        double r1138725 = sin(r1138724);
        double r1138726 = r1138723 * r1138725;
        return r1138726;
}

double f(double kx, double ky, double th) {
        double r1138727 = th;
        double r1138728 = sin(r1138727);
        double r1138729 = 1.0;
        double r1138730 = ky;
        double r1138731 = sin(r1138730);
        double r1138732 = kx;
        double r1138733 = sin(r1138732);
        double r1138734 = hypot(r1138731, r1138733);
        double r1138735 = r1138731 / r1138734;
        double r1138736 = r1138729 / r1138735;
        double r1138737 = r1138728 / r1138736;
        return r1138737;
}

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 13.1

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

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

    \[\leadsto \frac{\sin ky}{\color{blue}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \sin th\]
  4. Using strategy rm
  5. Applied clear-num9.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/9.3

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

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

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

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

Reproduce

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