Average Error: 12.2 → 8.6
Time: 20.7s
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 ky, \sin kx\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 ky, \sin kx\right)}
double f(double kx, double ky, double th) {
        double r48043 = ky;
        double r48044 = sin(r48043);
        double r48045 = kx;
        double r48046 = sin(r48045);
        double r48047 = 2.0;
        double r48048 = pow(r48046, r48047);
        double r48049 = pow(r48044, r48047);
        double r48050 = r48048 + r48049;
        double r48051 = sqrt(r48050);
        double r48052 = r48044 / r48051;
        double r48053 = th;
        double r48054 = sin(r48053);
        double r48055 = r48052 * r48054;
        return r48055;
}

double f(double kx, double ky, double th) {
        double r48056 = ky;
        double r48057 = sin(r48056);
        double r48058 = th;
        double r48059 = sin(r48058);
        double r48060 = kx;
        double r48061 = sin(r48060);
        double r48062 = hypot(r48057, r48061);
        double r48063 = r48059 / r48062;
        double r48064 = r48057 * r48063;
        return r48064;
}

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

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

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

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

    \[\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.7

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

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

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

Reproduce

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