Average Error: 12.5 → 8.9
Time: 29.5s
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 r1277250 = ky;
        double r1277251 = sin(r1277250);
        double r1277252 = kx;
        double r1277253 = sin(r1277252);
        double r1277254 = 2.0;
        double r1277255 = pow(r1277253, r1277254);
        double r1277256 = pow(r1277251, r1277254);
        double r1277257 = r1277255 + r1277256;
        double r1277258 = sqrt(r1277257);
        double r1277259 = r1277251 / r1277258;
        double r1277260 = th;
        double r1277261 = sin(r1277260);
        double r1277262 = r1277259 * r1277261;
        return r1277262;
}

double f(double kx, double ky, double th) {
        double r1277263 = th;
        double r1277264 = sin(r1277263);
        double r1277265 = ky;
        double r1277266 = sin(r1277265);
        double r1277267 = kx;
        double r1277268 = sin(r1277267);
        double r1277269 = hypot(r1277266, r1277268);
        double r1277270 = r1277266 / r1277269;
        double r1277271 = r1277264 * r1277270;
        return r1277271;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (kx ky th)
  :name "Toniolo and Linder, Equation (3b), real"
  (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))