Average Error: 12.5 → 8.8
Time: 35.1s
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 r1142513 = ky;
        double r1142514 = sin(r1142513);
        double r1142515 = kx;
        double r1142516 = sin(r1142515);
        double r1142517 = 2.0;
        double r1142518 = pow(r1142516, r1142517);
        double r1142519 = pow(r1142514, r1142517);
        double r1142520 = r1142518 + r1142519;
        double r1142521 = sqrt(r1142520);
        double r1142522 = r1142514 / r1142521;
        double r1142523 = th;
        double r1142524 = sin(r1142523);
        double r1142525 = r1142522 * r1142524;
        return r1142525;
}

double f(double kx, double ky, double th) {
        double r1142526 = th;
        double r1142527 = sin(r1142526);
        double r1142528 = ky;
        double r1142529 = sin(r1142528);
        double r1142530 = kx;
        double r1142531 = sin(r1142530);
        double r1142532 = hypot(r1142529, r1142531);
        double r1142533 = r1142529 / r1142532;
        double r1142534 = r1142527 * r1142533;
        return r1142534;
}

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. Simplified8.8

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

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

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

Reproduce

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