Average Error: 12.6 → 9.1
Time: 31.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 r472188 = ky;
        double r472189 = sin(r472188);
        double r472190 = kx;
        double r472191 = sin(r472190);
        double r472192 = 2.0;
        double r472193 = pow(r472191, r472192);
        double r472194 = pow(r472189, r472192);
        double r472195 = r472193 + r472194;
        double r472196 = sqrt(r472195);
        double r472197 = r472189 / r472196;
        double r472198 = th;
        double r472199 = sin(r472198);
        double r472200 = r472197 * r472199;
        return r472200;
}

double f(double kx, double ky, double th) {
        double r472201 = ky;
        double r472202 = sin(r472201);
        double r472203 = th;
        double r472204 = sin(r472203);
        double r472205 = kx;
        double r472206 = sin(r472205);
        double r472207 = hypot(r472202, r472206);
        double r472208 = r472204 / r472207;
        double r472209 = r472202 * r472208;
        return r472209;
}

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

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

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

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

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

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

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

Reproduce

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