Average Error: 12.3 → 8.9
Time: 9.9s
Precision: 64
\[\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th\]
\[\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)}}\]
\frac{\sin ky}{\sqrt{{\left(\sin kx\right)}^{2} + {\left(\sin ky\right)}^{2}}} \cdot \sin th
\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)}}
double f(double kx, double ky, double th) {
        double r38133 = ky;
        double r38134 = sin(r38133);
        double r38135 = kx;
        double r38136 = sin(r38135);
        double r38137 = 2.0;
        double r38138 = pow(r38136, r38137);
        double r38139 = pow(r38134, r38137);
        double r38140 = r38138 + r38139;
        double r38141 = sqrt(r38140);
        double r38142 = r38134 / r38141;
        double r38143 = th;
        double r38144 = sin(r38143);
        double r38145 = r38142 * r38144;
        return r38145;
}

double f(double kx, double ky, double th) {
        double r38146 = th;
        double r38147 = sin(r38146);
        double r38148 = ky;
        double r38149 = sin(r38148);
        double r38150 = kx;
        double r38151 = sin(r38150);
        double r38152 = hypot(r38149, r38151);
        double r38153 = sqrt(r38152);
        double r38154 = r38147 / r38153;
        double r38155 = r38149 / r38153;
        double r38156 = r38154 * r38155;
        return r38156;
}

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

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

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

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

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

    \[\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)}}}\]
  8. Applied *-un-lft-identity8.9

    \[\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)}}\]
  9. Applied times-frac9.0

    \[\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)}\]
  10. Applied associate-*r*9.0

    \[\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)}}}\]
  11. Simplified8.9

    \[\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)}}\]
  12. Final simplification8.9

    \[\leadsto \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)}}\]

Reproduce

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