Average Error: 12.5 → 8.9
Time: 57.7s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\sin th \cdot \frac{\sin ky}{\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 th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
double f(double kx, double ky, double th) {
        double r633584 = ky;
        double r633585 = sin(r633584);
        double r633586 = kx;
        double r633587 = sin(r633586);
        double r633588 = 2.0;
        double r633589 = pow(r633587, r633588);
        double r633590 = pow(r633585, r633588);
        double r633591 = r633589 + r633590;
        double r633592 = sqrt(r633591);
        double r633593 = r633585 / r633592;
        double r633594 = th;
        double r633595 = sin(r633594);
        double r633596 = r633593 * r633595;
        return r633596;
}

double f(double kx, double ky, double th) {
        double r633597 = th;
        double r633598 = sin(r633597);
        double r633599 = ky;
        double r633600 = sin(r633599);
        double r633601 = kx;
        double r633602 = sin(r633601);
        double r633603 = hypot(r633600, r633602);
        double r633604 = r633600 / r633603;
        double r633605 = r633598 * r633604;
        return r633605;
}

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. Simplified8.9

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

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

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

    \[\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. Using strategy rm
  8. Applied *-un-lft-identity9.2

    \[\leadsto \color{blue}{\left(1 \cdot \sin th\right)} \cdot \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)\]
  9. Applied associate-*l*9.2

    \[\leadsto \color{blue}{1 \cdot \left(\sin th \cdot \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)\right)}\]
  10. Simplified8.9

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

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

Reproduce

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