Average Error: 12.6 → 9.2
Time: 33.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 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 r1191253 = ky;
        double r1191254 = sin(r1191253);
        double r1191255 = kx;
        double r1191256 = sin(r1191255);
        double r1191257 = 2.0;
        double r1191258 = pow(r1191256, r1191257);
        double r1191259 = pow(r1191254, r1191257);
        double r1191260 = r1191258 + r1191259;
        double r1191261 = sqrt(r1191260);
        double r1191262 = r1191254 / r1191261;
        double r1191263 = th;
        double r1191264 = sin(r1191263);
        double r1191265 = r1191262 * r1191264;
        return r1191265;
}

double f(double kx, double ky, double th) {
        double r1191266 = ky;
        double r1191267 = sin(r1191266);
        double r1191268 = th;
        double r1191269 = sin(r1191268);
        double r1191270 = kx;
        double r1191271 = sin(r1191270);
        double r1191272 = hypot(r1191267, r1191271);
        double r1191273 = r1191269 / r1191272;
        double r1191274 = r1191267 * r1191273;
        return r1191274;
}

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

    \[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
  2. Simplified9.1

    \[\leadsto \color{blue}{\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt9.4

    \[\leadsto \sin th \cdot \frac{\sin ky}{\color{blue}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}}\]
  5. Applied *-un-lft-identity9.4

    \[\leadsto \sin th \cdot \frac{\color{blue}{1 \cdot \sin ky}}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\]
  6. Applied times-frac9.4

    \[\leadsto \sin th \cdot \color{blue}{\left(\frac{1}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}} \cdot \frac{\sin ky}{\sqrt{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}\right)}\]
  7. Applied associate-*r*9.5

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2) (pow (sin ky) 2)))) (sin th)))