Average Error: 12.5 → 8.9
Time: 33.7s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot \sin ky\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot \sin ky
double f(double kx, double ky, double th) {
        double r32185 = ky;
        double r32186 = sin(r32185);
        double r32187 = kx;
        double r32188 = sin(r32187);
        double r32189 = 2.0;
        double r32190 = pow(r32188, r32189);
        double r32191 = pow(r32186, r32189);
        double r32192 = r32190 + r32191;
        double r32193 = sqrt(r32192);
        double r32194 = r32186 / r32193;
        double r32195 = th;
        double r32196 = sin(r32195);
        double r32197 = r32194 * r32196;
        return r32197;
}

double f(double kx, double ky, double th) {
        double r32198 = th;
        double r32199 = sin(r32198);
        double r32200 = kx;
        double r32201 = sin(r32200);
        double r32202 = ky;
        double r32203 = sin(r32202);
        double r32204 = hypot(r32201, r32203);
        double r32205 = r32199 / r32204;
        double r32206 = r32205 * r32203;
        return r32206;
}

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

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

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

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

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

    \[\leadsto \color{blue}{\sin ky \cdot \left(\frac{1}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot \sin th\right)}\]
  7. Simplified8.9

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

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

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

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

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

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

Reproduce

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