\[\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, \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\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) (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) / 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(ew, Float64(sin(t) / hypot(1.0, Float64(eh / Float64(ew * tan(t))))), Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(eh / 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[(ew * N[(N[Sin[t], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $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, \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right)\right|
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 52480 |
|---|
\[\left|\frac{ew \cdot \sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)} + \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|
\]
| Alternative 2 |
|---|
| Error | 0.7 |
|---|
| Cost | 52416 |
|---|
\[\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(eh \cdot \cos t\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|
\]
| Alternative 3 |
|---|
| Error | 1.1 |
|---|
| Cost | 45504 |
|---|
\[\left|\mathsf{fma}\left(ew, \sin t, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right)\right|
\]
| Alternative 4 |
|---|
| Error | 9.4 |
|---|
| Cost | 32968 |
|---|
\[\begin{array}{l}
t_1 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\mathbf{if}\;eh \leq -12322402.271103933:\\
\;\;\;\;t_1\\
\mathbf{elif}\;eh \leq 1.6520206599387364 \cdot 10^{-32}:\\
\;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 9.5 |
|---|
| Cost | 32840 |
|---|
\[\begin{array}{l}
t_1 := \frac{eh}{ew \cdot \tan t}\\
t_2 := \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} t_1\right|\\
\mathbf{if}\;eh \leq -12322402.271103933:\\
\;\;\;\;t_2\\
\mathbf{elif}\;eh \leq 1.6520206599387364 \cdot 10^{-32}:\\
\;\;\;\;\left|eh + ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, t_1\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 13.6 |
|---|
| Cost | 26368 |
|---|
\[\left|eh + ew \cdot \frac{\sin t}{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}\right|
\]
| Alternative 7 |
|---|
| Error | 30.3 |
|---|
| Cost | 26304 |
|---|
\[\left|eh + t \cdot \left(ew \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|
\]
| Alternative 8 |
|---|
| Error | 37.2 |
|---|
| Cost | 6464 |
|---|
\[\left|eh\right|
\]