Average Error: 4.0 → 0.2
Time: 9.8s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
double f(double kx, double ky, double th) {
        double r44110 = ky;
        double r44111 = sin(r44110);
        double r44112 = kx;
        double r44113 = sin(r44112);
        double r44114 = 2.0;
        double r44115 = pow(r44113, r44114);
        double r44116 = pow(r44111, r44114);
        double r44117 = r44115 + r44116;
        double r44118 = sqrt(r44117);
        double r44119 = r44111 / r44118;
        double r44120 = th;
        double r44121 = sin(r44120);
        double r44122 = r44119 * r44121;
        return r44122;
}

double f(double kx, double ky, double th) {
        double r44123 = ky;
        double r44124 = sin(r44123);
        double r44125 = kx;
        double r44126 = sin(r44125);
        double r44127 = hypot(r44124, r44126);
        double r44128 = r44124 / r44127;
        double r44129 = th;
        double r44130 = sin(r44129);
        double r44131 = r44128 * r44130;
        return r44131;
}

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 4.0

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}} \cdot \sin th\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.3

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

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

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

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

Reproduce

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