Average Error: 12.6 → 9.0
Time: 34.3s
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 kx, \sin ky\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 kx, \sin ky\right)}{\sin ky}}
double f(double kx, double ky, double th) {
        double r35113 = ky;
        double r35114 = sin(r35113);
        double r35115 = kx;
        double r35116 = sin(r35115);
        double r35117 = 2.0;
        double r35118 = pow(r35116, r35117);
        double r35119 = pow(r35114, r35117);
        double r35120 = r35118 + r35119;
        double r35121 = sqrt(r35120);
        double r35122 = r35114 / r35121;
        double r35123 = th;
        double r35124 = sin(r35123);
        double r35125 = r35122 * r35124;
        return r35125;
}

double f(double kx, double ky, double th) {
        double r35126 = th;
        double r35127 = sin(r35126);
        double r35128 = kx;
        double r35129 = sin(r35128);
        double r35130 = ky;
        double r35131 = sin(r35130);
        double r35132 = hypot(r35129, r35131);
        double r35133 = r35132 / r35131;
        double r35134 = r35127 / r35133;
        return r35134;
}

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}}} \cdot \sin th\]
  6. Using strategy rm
  7. Applied *-un-lft-identity9.0

    \[\leadsto \frac{1}{\color{blue}{1 \cdot \frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}}} \cdot \sin th\]
  8. Applied *-un-lft-identity9.0

    \[\leadsto \frac{\color{blue}{1 \cdot 1}}{1 \cdot \frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{\sin ky}} \cdot \sin th\]
  9. Applied times-frac9.0

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

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

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

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

Reproduce

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