Average Error: 12.3 → 8.7
Time: 30.0s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)}
double f(double kx, double ky, double th) {
        double r1596909 = ky;
        double r1596910 = sin(r1596909);
        double r1596911 = kx;
        double r1596912 = sin(r1596911);
        double r1596913 = 2.0;
        double r1596914 = pow(r1596912, r1596913);
        double r1596915 = pow(r1596910, r1596913);
        double r1596916 = r1596914 + r1596915;
        double r1596917 = sqrt(r1596916);
        double r1596918 = r1596910 / r1596917;
        double r1596919 = th;
        double r1596920 = sin(r1596919);
        double r1596921 = r1596918 * r1596920;
        return r1596921;
}

double f(double kx, double ky, double th) {
        double r1596922 = ky;
        double r1596923 = sin(r1596922);
        double r1596924 = th;
        double r1596925 = sin(r1596924);
        double r1596926 = kx;
        double r1596927 = sin(r1596926);
        double r1596928 = hypot(r1596927, r1596923);
        double r1596929 = r1596925 / r1596928;
        double r1596930 = r1596923 * r1596929;
        return r1596930;
}

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

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

    \[\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 kx, \sin ky\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 kx, \sin ky\right)}\right)} \cdot \sin th\]
  6. Applied associate-*l*8.8

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

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

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

Reproduce

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