\[2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)
\]
↓
\[\begin{array}{l}
t_0 := \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\\
t_1 := t_0 \cdot 2\\
t_2 := \frac{\pi \cdot 2}{3} - t_0\\
2 \cdot \left(\cos t_2 \cdot \cos t_1 - \sin t_1 \cdot \sin t_2\right)
\end{array}
\]
(FPCore (g h)
:precision binary64
(* 2.0 (cos (+ (/ (* 2.0 PI) 3.0) (/ (acos (/ (- g) h)) 3.0)))))
↓
(FPCore (g h)
:precision binary64
(let* ((t_0 (/ (acos (/ (- g) h)) 3.0))
(t_1 (* t_0 2.0))
(t_2 (- (/ (* PI 2.0) 3.0) t_0)))
(* 2.0 (- (* (cos t_2) (cos t_1)) (* (sin t_1) (sin t_2))))))double code(double g, double h) {
return 2.0 * cos((((2.0 * ((double) M_PI)) / 3.0) + (acos((-g / h)) / 3.0)));
}
↓
double code(double g, double h) {
double t_0 = acos((-g / h)) / 3.0;
double t_1 = t_0 * 2.0;
double t_2 = ((((double) M_PI) * 2.0) / 3.0) - t_0;
return 2.0 * ((cos(t_2) * cos(t_1)) - (sin(t_1) * sin(t_2)));
}
public static double code(double g, double h) {
return 2.0 * Math.cos((((2.0 * Math.PI) / 3.0) + (Math.acos((-g / h)) / 3.0)));
}
↓
public static double code(double g, double h) {
double t_0 = Math.acos((-g / h)) / 3.0;
double t_1 = t_0 * 2.0;
double t_2 = ((Math.PI * 2.0) / 3.0) - t_0;
return 2.0 * ((Math.cos(t_2) * Math.cos(t_1)) - (Math.sin(t_1) * Math.sin(t_2)));
}
def code(g, h):
return 2.0 * math.cos((((2.0 * math.pi) / 3.0) + (math.acos((-g / h)) / 3.0)))
↓
def code(g, h):
t_0 = math.acos((-g / h)) / 3.0
t_1 = t_0 * 2.0
t_2 = ((math.pi * 2.0) / 3.0) - t_0
return 2.0 * ((math.cos(t_2) * math.cos(t_1)) - (math.sin(t_1) * math.sin(t_2)))
function code(g, h)
return Float64(2.0 * cos(Float64(Float64(Float64(2.0 * pi) / 3.0) + Float64(acos(Float64(Float64(-g) / h)) / 3.0))))
end
↓
function code(g, h)
t_0 = Float64(acos(Float64(Float64(-g) / h)) / 3.0)
t_1 = Float64(t_0 * 2.0)
t_2 = Float64(Float64(Float64(pi * 2.0) / 3.0) - t_0)
return Float64(2.0 * Float64(Float64(cos(t_2) * cos(t_1)) - Float64(sin(t_1) * sin(t_2))))
end
function tmp = code(g, h)
tmp = 2.0 * cos((((2.0 * pi) / 3.0) + (acos((-g / h)) / 3.0)));
end
↓
function tmp = code(g, h)
t_0 = acos((-g / h)) / 3.0;
t_1 = t_0 * 2.0;
t_2 = ((pi * 2.0) / 3.0) - t_0;
tmp = 2.0 * ((cos(t_2) * cos(t_1)) - (sin(t_1) * sin(t_2)));
end
code[g_, h_] := N[(2.0 * N[Cos[N[(N[(N[(2.0 * Pi), $MachinePrecision] / 3.0), $MachinePrecision] + N[(N[ArcCos[N[((-g) / h), $MachinePrecision]], $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[g_, h_] := Block[{t$95$0 = N[(N[ArcCos[N[((-g) / h), $MachinePrecision]], $MachinePrecision] / 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(Pi * 2.0), $MachinePrecision] / 3.0), $MachinePrecision] - t$95$0), $MachinePrecision]}, N[(2.0 * N[(N[(N[Cos[t$95$2], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t$95$1], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)
↓
\begin{array}{l}
t_0 := \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\\
t_1 := t_0 \cdot 2\\
t_2 := \frac{\pi \cdot 2}{3} - t_0\\
2 \cdot \left(\cos t_2 \cdot \cos t_1 - \sin t_1 \cdot \sin t_2\right)
\end{array}