Average Error: 12.5 → 8.9
Time: 34.2s
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 r1033828 = ky;
        double r1033829 = sin(r1033828);
        double r1033830 = kx;
        double r1033831 = sin(r1033830);
        double r1033832 = 2.0;
        double r1033833 = pow(r1033831, r1033832);
        double r1033834 = pow(r1033829, r1033832);
        double r1033835 = r1033833 + r1033834;
        double r1033836 = sqrt(r1033835);
        double r1033837 = r1033829 / r1033836;
        double r1033838 = th;
        double r1033839 = sin(r1033838);
        double r1033840 = r1033837 * r1033839;
        return r1033840;
}

double f(double kx, double ky, double th) {
        double r1033841 = th;
        double r1033842 = sin(r1033841);
        double r1033843 = ky;
        double r1033844 = sin(r1033843);
        double r1033845 = kx;
        double r1033846 = sin(r1033845);
        double r1033847 = hypot(r1033844, r1033846);
        double r1033848 = r1033844 / r1033847;
        double r1033849 = r1033842 * r1033848;
        return r1033849;
}

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. Applied *-un-lft-identity8.9

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

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

    \[\leadsto \left(\color{blue}{1} \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\right) \cdot \sin th\]
  9. 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)))