\[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\]
↓
\[\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|
\]
(FPCore (eh ew t)
:precision binary64
(fabs
(+
(* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t)))))
(* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
↓
(FPCore (eh ew t)
:precision binary64
(fabs
(fma
(* ew (sin t))
(/ 1.0 (hypot 1.0 (/ (/ eh ew) (tan t))))
(* eh (* (cos t) (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
}
↓
double code(double eh, double ew, double t) {
return fabs(fma((ew * sin(t)), (1.0 / hypot(1.0, ((eh / ew) / tan(t)))), (eh * (cos(t) * sin(atan((eh / (ew * tan(t)))))))));
}
function code(eh, ew, t)
return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))
end
↓
function code(eh, ew, t)
return abs(fma(Float64(ew * sin(t)), Float64(1.0 / hypot(1.0, Float64(Float64(eh / ew) / tan(t)))), Float64(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * tan(t)))))))))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
↓
\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{\tan t}\right)}, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|
Alternatives
| Alternative 1 |
|---|
| Accuracy | 99.8% |
|---|
| Cost | 52608 |
|---|
\[\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\frac{1}{\mathsf{hypot}\left(1, t_1\right)} \cdot \left(ew \cdot \sin t\right) + \sin \tan^{-1} t_1 \cdot \left(eh \cdot \cos t\right)\right|
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 99.0% |
|---|
| Cost | 52416 |
|---|
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \left(ew \cdot \sin t\right)\right|
\]
| Alternative 3 |
|---|
| Accuracy | 98.4% |
|---|
| Cost | 39232 |
|---|
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + ew \cdot \sin t\right|
\]
| Alternative 4 |
|---|
| Accuracy | 97.9% |
|---|
| Cost | 19648 |
|---|
\[\left|ew \cdot \sin t + eh \cdot \cos t\right|
\]
| Alternative 5 |
|---|
| Accuracy | 97.9% |
|---|
| Cost | 19648 |
|---|
\[\left|ew \cdot \sin t - eh \cdot \cos t\right|
\]
| Alternative 6 |
|---|
| Accuracy | 78.5% |
|---|
| Cost | 13120 |
|---|
\[\left|eh + ew \cdot \sin t\right|
\]
| Alternative 7 |
|---|
| Accuracy | 42.3% |
|---|
| Cost | 12992 |
|---|
\[\left|ew \cdot \sin t\right|
\]