Average Error: 12.5 → 8.9
Time: 25.3s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{1}{\frac{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}{\sin th}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{1}{\frac{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}{\sin th}}
double f(double kx, double ky, double th) {
        double r32080 = ky;
        double r32081 = sin(r32080);
        double r32082 = kx;
        double r32083 = sin(r32082);
        double r32084 = 2.0;
        double r32085 = pow(r32083, r32084);
        double r32086 = pow(r32081, r32084);
        double r32087 = r32085 + r32086;
        double r32088 = sqrt(r32087);
        double r32089 = r32081 / r32088;
        double r32090 = th;
        double r32091 = sin(r32090);
        double r32092 = r32089 * r32091;
        return r32092;
}

double f(double kx, double ky, double th) {
        double r32093 = 1.0;
        double r32094 = ky;
        double r32095 = sin(r32094);
        double r32096 = kx;
        double r32097 = sin(r32096);
        double r32098 = hypot(r32095, r32097);
        double r32099 = r32098 / r32095;
        double r32100 = th;
        double r32101 = sin(r32100);
        double r32102 = r32099 / r32101;
        double r32103 = r32093 / r32102;
        return r32103;
}

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 ky\right)}^{2} + {\left(\sin kx\right)}^{2}}}} \cdot \sin th\]
  3. Simplified8.7

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(\sin ky\right)}^{1}} \cdot {\left(\frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right)}^{1}\]
  11. Applied pow-prod-down8.7

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

    \[\leadsto {\color{blue}{\left(\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}\right)}}^{1}\]
  13. Using strategy rm
  14. Applied clear-num8.9

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

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

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

Reproduce

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