| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 45440 |
\[\mathsf{expm1}\left({\left(\sqrt{\mathsf{log1p}\left(\cos^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\right)}\right)}^{2}\right)
\]
(FPCore (v) :precision binary64 (acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))
(FPCore (v)
:precision binary64
(let* ((t_0 (cbrt (* PI 0.5))))
(expm1
(pow
(sqrt
(log1p
(fma
(pow t_0 2.0)
t_0
(- (asin (/ (fma v (* v -5.0) 1.0) (fma v v -1.0)))))))
2.0))))double code(double v) {
return acos(((1.0 - (5.0 * (v * v))) / ((v * v) - 1.0)));
}
double code(double v) {
double t_0 = cbrt((((double) M_PI) * 0.5));
return expm1(pow(sqrt(log1p(fma(pow(t_0, 2.0), t_0, -asin((fma(v, (v * -5.0), 1.0) / fma(v, v, -1.0)))))), 2.0));
}
function code(v) return acos(Float64(Float64(1.0 - Float64(5.0 * Float64(v * v))) / Float64(Float64(v * v) - 1.0))) end
function code(v) t_0 = cbrt(Float64(pi * 0.5)) return expm1((sqrt(log1p(fma((t_0 ^ 2.0), t_0, Float64(-asin(Float64(fma(v, Float64(v * -5.0), 1.0) / fma(v, v, -1.0))))))) ^ 2.0)) end
code[v_] := N[ArcCos[N[(N[(1.0 - N[(5.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(v * v), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[v_] := Block[{t$95$0 = N[Power[N[(Pi * 0.5), $MachinePrecision], 1/3], $MachinePrecision]}, N[(Exp[N[Power[N[Sqrt[N[Log[1 + N[(N[Power[t$95$0, 2.0], $MachinePrecision] * t$95$0 + (-N[ArcSin[N[(N[(v * N[(v * -5.0), $MachinePrecision] + 1.0), $MachinePrecision] / N[(v * v + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]] - 1), $MachinePrecision]]
\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)
\begin{array}{l}
t_0 := \sqrt[3]{\pi \cdot 0.5}\\
\mathsf{expm1}\left({\left(\sqrt{\mathsf{log1p}\left(\mathsf{fma}\left({t_0}^{2}, t_0, -\sin^{-1} \left(\frac{\mathsf{fma}\left(v, v \cdot -5, 1\right)}{\mathsf{fma}\left(v, v, -1\right)}\right)\right)\right)}\right)}^{2}\right)
\end{array}
Initial program 0.5
Applied egg-rr0.5
Applied egg-rr0.5
Applied egg-rr0.5
Final simplification0.5
| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 45440 |
| Alternative 2 | |
|---|---|
| Error | 0.5 |
| Cost | 7232 |
| Alternative 3 | |
|---|---|
| Error | 1.3 |
| Cost | 6464 |
herbie shell --seed 2022312
(FPCore (v)
:name "Falkner and Boettcher, Appendix B, 1"
:precision binary64
(acos (/ (- 1.0 (* 5.0 (* v v))) (- (* v v) 1.0))))