?

Average Error: 4.2 → 4.3
Time: 59.0s
Precision: binary64
Cost: 45376

?

\[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th \]
\[\sin ky \cdot \frac{\sin th}{\sqrt{{\sin ky}^{2} + {\sin kx}^{2}}} \]
(FPCore (kx ky th)
 :precision binary64
 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
(FPCore (kx ky th)
 :precision binary64
 (* (sin ky) (/ (sin th) (sqrt (+ (pow (sin ky) 2.0) (pow (sin kx) 2.0))))))
double code(double kx, double ky, double th) {
	return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
double code(double kx, double ky, double th) {
	return sin(ky) * (sin(th) / sqrt((pow(sin(ky), 2.0) + pow(sin(kx), 2.0))));
}
real(8) function code(kx, ky, th)
    real(8), intent (in) :: kx
    real(8), intent (in) :: ky
    real(8), intent (in) :: th
    code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
real(8) function code(kx, ky, th)
    real(8), intent (in) :: kx
    real(8), intent (in) :: ky
    real(8), intent (in) :: th
    code = sin(ky) * (sin(th) / sqrt(((sin(ky) ** 2.0d0) + (sin(kx) ** 2.0d0))))
end function
public static double code(double kx, double ky, double th) {
	return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
public static double code(double kx, double ky, double th) {
	return Math.sin(ky) * (Math.sin(th) / Math.sqrt((Math.pow(Math.sin(ky), 2.0) + Math.pow(Math.sin(kx), 2.0))));
}
def code(kx, ky, th):
	return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
def code(kx, ky, th):
	return math.sin(ky) * (math.sin(th) / math.sqrt((math.pow(math.sin(ky), 2.0) + math.pow(math.sin(kx), 2.0))))
function code(kx, ky, th)
	return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th))
end
function code(kx, ky, th)
	return Float64(sin(ky) * Float64(sin(th) / sqrt(Float64((sin(ky) ^ 2.0) + (sin(kx) ^ 2.0)))))
end
function tmp = code(kx, ky, th)
	tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th);
end
function tmp = code(kx, ky, th)
	tmp = sin(ky) * (sin(th) / sqrt(((sin(ky) ^ 2.0) + (sin(kx) ^ 2.0))));
end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\sin ky \cdot \frac{\sin th}{\sqrt{{\sin ky}^{2} + {\sin kx}^{2}}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 4.2

    \[\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th \]
  2. Applied egg-rr4.3

    \[\leadsto \color{blue}{\sin ky \cdot \frac{\sin th}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} + 0} \]
  3. Simplified4.3

    \[\leadsto \color{blue}{\sin ky \cdot \frac{\sin th}{\sqrt{{\sin ky}^{2} + {\sin kx}^{2}}}} \]
    Proof

    [Start]4.3

    \[ \sin ky \cdot \frac{\sin th}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} + 0 \]

    rational.json-simplify-4 [=>]4.3

    \[ \color{blue}{\sin ky \cdot \frac{\sin th}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}} \]

    rational.json-simplify-1 [<=]4.3

    \[ \sin ky \cdot \frac{\sin th}{\sqrt{\color{blue}{{\sin ky}^{2} + {\sin kx}^{2}}}} \]
  4. Final simplification4.3

    \[\leadsto \sin ky \cdot \frac{\sin th}{\sqrt{{\sin ky}^{2} + {\sin kx}^{2}}} \]

Alternatives

Alternative 1
Error10.2
Cost123208
\[\begin{array}{l} t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\ \mathbf{if}\;t_1 \leq -1:\\ \;\;\;\;\frac{\sin th}{\frac{-ky}{\sin ky}}\\ \mathbf{elif}\;t_1 \leq 2:\\ \;\;\;\;t_1 \cdot \sin th\\ \mathbf{else}:\\ \;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\ \end{array} \]
Alternative 2
Error33.9
Cost71960
\[\begin{array}{l} t_1 := \frac{\sin ky}{0.5 \cdot \frac{{ky}^{2}}{\sin kx} + \sin kx} \cdot \sin th\\ \mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-305}:\\ \;\;\;\;\frac{\sin th}{\frac{\left(-ky\right) + -0.5 \cdot \frac{{\sin kx}^{2}}{ky}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 10^{-166}:\\ \;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\ \mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + {ky}^{2}}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 3
Error34.0
Cost65236
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-305}:\\ \;\;\;\;\frac{\sin th}{\frac{\left(-ky\right) + -0.5 \cdot \frac{{\sin kx}^{2}}{ky}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 10^{-166}:\\ \;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\ \mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + {ky}^{2}}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 4
Error18.1
Cost58572
\[\begin{array}{l} t_1 := {\sin kx}^{2}\\ t_2 := {\sin ky}^{2}\\ \mathbf{if}\;\sin ky \leq -0.92:\\ \;\;\;\;th \cdot \left(\sin ky \cdot \sqrt{\frac{1}{t_2 + t_1}}\right)\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + t_2}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 0.04:\\ \;\;\;\;\frac{\sin ky}{\sqrt{t_1 + {ky}^{2}}} \cdot \sin th\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 5
Error18.1
Cost58572
\[\begin{array}{l} t_1 := {\sin kx}^{2}\\ t_2 := {\sin ky}^{2}\\ \mathbf{if}\;\sin ky \leq -0.92:\\ \;\;\;\;\sin ky \cdot \left(th \cdot \sqrt{\frac{1}{t_2 + t_1}}\right)\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + t_2}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 0.04:\\ \;\;\;\;\frac{\sin ky}{\sqrt{t_1 + {ky}^{2}}} \cdot \sin th\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 6
Error21.1
Cost52040
\[\begin{array}{l} \mathbf{if}\;\sin kx \leq -0.08:\\ \;\;\;\;\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \left(\sin ky \cdot th\right)\\ \mathbf{elif}\;\sin kx \leq 10^{-7}:\\ \;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\ \end{array} \]
Alternative 7
Error17.9
Cost52040
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -1 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sin ky}{\sqrt{{kx}^{2} + {\sin ky}^{2}}} \cdot \sin th\\ \mathbf{elif}\;\sin ky \leq 0.04:\\ \;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 8
Error17.9
Cost52040
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -1 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sin th}{\frac{\sqrt{{kx}^{2} + {\sin ky}^{2}}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 0.04:\\ \;\;\;\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {ky}^{2}}} \cdot \sin th\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 9
Error35.1
Cost46028
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-305}:\\ \;\;\;\;\frac{\sin th}{\frac{\left(-ky\right) + -0.5 \cdot \frac{{\sin kx}^{2}}{ky}}{\sin ky}}\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 10
Error38.3
Cost39376
\[\begin{array}{l} t_1 := \sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\ \mathbf{if}\;\sin ky \leq -1 \cdot 10^{-12}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 11
Error34.1
Cost39376
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -4 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{1}{{\sin ky}^{2}}} \cdot \left(\sin ky \cdot th\right)\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\ \;\;\;\;\sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 12
Error38.3
Cost39248
\[\begin{array}{l} t_1 := \sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\ \mathbf{if}\;\sin ky \leq -1 \cdot 10^{-12}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 13
Error38.1
Cost32844
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sin ky}{\sin kx} \cdot \sin th\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\ \;\;\;\;\sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 14
Error38.1
Cost32844
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq -1 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sin ky}{\sin kx} \cdot \frac{1}{\frac{1}{\sin th}}\\ \mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-176}:\\ \;\;\;\;\sin ky \cdot \left(-\frac{\sin th}{ky}\right)\\ \mathbf{elif}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;\sin th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 15
Error35.5
Cost32712
\[\begin{array}{l} \mathbf{if}\;\sin kx \leq -1 \cdot 10^{-24}:\\ \;\;\;\;\sqrt{\frac{1}{{\sin kx}^{2}}} \cdot \left(\sin ky \cdot th\right)\\ \mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-38}:\\ \;\;\;\;\frac{1}{\frac{\sin ky}{\sin ky \cdot \sin th}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin th}{\sin kx} \cdot \sin ky\\ \end{array} \]
Alternative 16
Error38.6
Cost19652
\[\begin{array}{l} \mathbf{if}\;\sin ky \leq 10^{-16}:\\ \;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 17
Error42.6
Cost7112
\[\begin{array}{l} \mathbf{if}\;ky \leq -4.2 \cdot 10^{-10}:\\ \;\;\;\;\sin th\\ \mathbf{elif}\;ky \leq 5.2 \cdot 10^{-200}:\\ \;\;\;\;th \cdot \left(\frac{1}{\sin kx} \cdot ky\right)\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 18
Error41.8
Cost6984
\[\begin{array}{l} \mathbf{if}\;ky \leq -3 \cdot 10^{-10}:\\ \;\;\;\;\sin th\\ \mathbf{elif}\;ky \leq 4.7 \cdot 10^{-168}:\\ \;\;\;\;ky \cdot \frac{\sin th}{kx}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 19
Error42.6
Cost6984
\[\begin{array}{l} \mathbf{if}\;ky \leq -3.6 \cdot 10^{-10}:\\ \;\;\;\;\sin th\\ \mathbf{elif}\;ky \leq 3.4 \cdot 10^{-199}:\\ \;\;\;\;th \cdot \frac{ky}{\sin kx}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 20
Error43.6
Cost6728
\[\begin{array}{l} \mathbf{if}\;ky \leq -4.2 \cdot 10^{-10}:\\ \;\;\;\;\sin th\\ \mathbf{elif}\;ky \leq 2.8 \cdot 10^{-168}:\\ \;\;\;\;\frac{\frac{th}{0.5}}{kx \cdot \frac{2}{ky}}\\ \mathbf{else}:\\ \;\;\;\;\sin th\\ \end{array} \]
Alternative 21
Error49.8
Cost840
\[\begin{array}{l} \mathbf{if}\;ky \leq -4.2 \cdot 10^{-12}:\\ \;\;\;\;th\\ \mathbf{elif}\;ky \leq 4 \cdot 10^{-100}:\\ \;\;\;\;\frac{2}{\frac{kx}{ky} \cdot \frac{2}{th}}\\ \mathbf{else}:\\ \;\;\;\;th\\ \end{array} \]
Alternative 22
Error49.7
Cost840
\[\begin{array}{l} \mathbf{if}\;ky \leq -1.3 \cdot 10^{-11}:\\ \;\;\;\;th\\ \mathbf{elif}\;ky \leq 7 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{th}{0.5}}{kx \cdot \frac{2}{ky}}\\ \mathbf{else}:\\ \;\;\;\;th\\ \end{array} \]
Alternative 23
Error49.8
Cost584
\[\begin{array}{l} \mathbf{if}\;ky \leq -2.75 \cdot 10^{-12}:\\ \;\;\;\;th\\ \mathbf{elif}\;ky \leq 2.1 \cdot 10^{-100}:\\ \;\;\;\;ky \cdot \frac{th}{kx}\\ \mathbf{else}:\\ \;\;\;\;th\\ \end{array} \]
Alternative 24
Error49.7
Cost584
\[\begin{array}{l} \mathbf{if}\;ky \leq -5.5 \cdot 10^{-12}:\\ \;\;\;\;th\\ \mathbf{elif}\;ky \leq 4.2 \cdot 10^{-100}:\\ \;\;\;\;th \cdot \frac{ky}{kx}\\ \mathbf{else}:\\ \;\;\;\;th\\ \end{array} \]
Alternative 25
Error49.7
Cost584
\[\begin{array}{l} \mathbf{if}\;ky \leq -4.2 \cdot 10^{-11}:\\ \;\;\;\;th\\ \mathbf{elif}\;ky \leq 1.7 \cdot 10^{-100}:\\ \;\;\;\;\frac{th}{\frac{kx}{ky}}\\ \mathbf{else}:\\ \;\;\;\;th\\ \end{array} \]
Alternative 26
Error54.8
Cost64
\[th \]

Error

Reproduce?

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