Average Error: 12.3 → 8.7
Time: 29.5s
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 r1186944 = ky;
        double r1186945 = sin(r1186944);
        double r1186946 = kx;
        double r1186947 = sin(r1186946);
        double r1186948 = 2.0;
        double r1186949 = pow(r1186947, r1186948);
        double r1186950 = pow(r1186945, r1186948);
        double r1186951 = r1186949 + r1186950;
        double r1186952 = sqrt(r1186951);
        double r1186953 = r1186945 / r1186952;
        double r1186954 = th;
        double r1186955 = sin(r1186954);
        double r1186956 = r1186953 * r1186955;
        return r1186956;
}

double f(double kx, double ky, double th) {
        double r1186957 = ky;
        double r1186958 = sin(r1186957);
        double r1186959 = th;
        double r1186960 = sin(r1186959);
        double r1186961 = kx;
        double r1186962 = sin(r1186961);
        double r1186963 = hypot(r1186962, r1186958);
        double r1186964 = r1186960 / r1186963;
        double r1186965 = r1186958 * r1186964;
        return r1186965;
}

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)))