Average Error: 12.2 → 8.6
Time: 48.5s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin th \cdot \frac{1}{\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
\sin th \cdot \frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
double f(double kx, double ky, double th) {
        double r868831 = ky;
        double r868832 = sin(r868831);
        double r868833 = kx;
        double r868834 = sin(r868833);
        double r868835 = 2.0;
        double r868836 = pow(r868834, r868835);
        double r868837 = pow(r868832, r868835);
        double r868838 = r868836 + r868837;
        double r868839 = sqrt(r868838);
        double r868840 = r868832 / r868839;
        double r868841 = th;
        double r868842 = sin(r868841);
        double r868843 = r868840 * r868842;
        return r868843;
}

double f(double kx, double ky, double th) {
        double r868844 = th;
        double r868845 = sin(r868844);
        double r868846 = 1.0;
        double r868847 = ky;
        double r868848 = sin(r868847);
        double r868849 = kx;
        double r868850 = sin(r868849);
        double r868851 = hypot(r868848, r868850);
        double r868852 = r868851 / r868848;
        double r868853 = r868846 / r868852;
        double r868854 = r868845 * r868853;
        return r868854;
}

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 12.2

    \[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
  2. Simplified8.5

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

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

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

Reproduce

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