Average Error: 12.0 → 8.5
Time: 49.7s
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 r699909 = ky;
        double r699910 = sin(r699909);
        double r699911 = kx;
        double r699912 = sin(r699911);
        double r699913 = 2.0;
        double r699914 = pow(r699912, r699913);
        double r699915 = pow(r699910, r699913);
        double r699916 = r699914 + r699915;
        double r699917 = sqrt(r699916);
        double r699918 = r699910 / r699917;
        double r699919 = th;
        double r699920 = sin(r699919);
        double r699921 = r699918 * r699920;
        return r699921;
}

double f(double kx, double ky, double th) {
        double r699922 = th;
        double r699923 = sin(r699922);
        double r699924 = 1.0;
        double r699925 = ky;
        double r699926 = sin(r699925);
        double r699927 = kx;
        double r699928 = sin(r699927);
        double r699929 = hypot(r699926, r699928);
        double r699930 = r699929 / r699926;
        double r699931 = r699924 / r699930;
        double r699932 = r699923 * r699931;
        return r699932;
}

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.0

    \[\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 *-un-lft-identity8.5

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

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

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

Reproduce

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