Average Error: 12.6 → 8.7
Time: 9.8s
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 r43142 = ky;
        double r43143 = sin(r43142);
        double r43144 = kx;
        double r43145 = sin(r43144);
        double r43146 = 2.0;
        double r43147 = pow(r43145, r43146);
        double r43148 = pow(r43143, r43146);
        double r43149 = r43147 + r43148;
        double r43150 = sqrt(r43149);
        double r43151 = r43143 / r43150;
        double r43152 = th;
        double r43153 = sin(r43152);
        double r43154 = r43151 * r43153;
        return r43154;
}

double f(double kx, double ky, double th) {
        double r43155 = th;
        double r43156 = sin(r43155);
        double r43157 = ky;
        double r43158 = sin(r43157);
        double r43159 = kx;
        double r43160 = sin(r43159);
        double r43161 = hypot(r43158, r43160);
        double r43162 = r43158 / r43161;
        double r43163 = r43156 * r43162;
        return r43163;
}

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. Taylor expanded around inf 12.6

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

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

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

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

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

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

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

Reproduce

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