Math FPCore C Julia Wolfram TeX \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1
\]
↓
\[\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), b \cdot \left(b \cdot \mathsf{fma}\left(a, -3, 1\right)\right)\right), {\left(\mathsf{hypot}\left(a, b\right)\right)}^{4}\right) + -1
\]
(FPCore (a b)
:precision binary64
(-
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a))))))
1.0)) ↓
(FPCore (a b)
:precision binary64
(+
(fma
4.0
(fma a (fma a a a) (* b (* b (fma a -3.0 1.0))))
(pow (hypot a b) 4.0))
-1.0)) double code(double a, double b) {
return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
}
↓
double code(double a, double b) {
return fma(4.0, fma(a, fma(a, a, a), (b * (b * fma(a, -3.0, 1.0)))), pow(hypot(a, b), 4.0)) + -1.0;
}
function code(a, b)
return Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 + a)) + Float64(Float64(b * b) * Float64(1.0 - Float64(3.0 * a)))))) - 1.0)
end
↓
function code(a, b)
return Float64(fma(4.0, fma(a, fma(a, a, a), Float64(b * Float64(b * fma(a, -3.0, 1.0)))), (hypot(a, b) ^ 4.0)) + -1.0)
end
code[a_, b_] := N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 + a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(1.0 - N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
↓
code[a_, b_] := N[(N[(4.0 * N[(a * N[(a * a + a), $MachinePrecision] + N[(b * N[(b * N[(a * -3.0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1
↓
\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), b \cdot \left(b \cdot \mathsf{fma}\left(a, -3, 1\right)\right)\right), {\left(\mathsf{hypot}\left(a, b\right)\right)}^{4}\right) + -1
Alternatives Alternative 1 Error 0.1 Cost 15104
\[-1 + \left(\left(b \cdot \left(b \cdot \mathsf{fma}\left(b, b, a \cdot \left(a \cdot 2\right)\right)\right) + {a}^{4}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 + a \cdot -3\right)\right)\right)
\]
Alternative 2 Error 0.2 Cost 8704
\[-1 + \left(\left({a}^{4} + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(a \cdot \left(a \cdot 2\right)\right) \cdot \left(b \cdot b\right)\right)\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + b \cdot b\right)\right)
\]
Alternative 3 Error 0.2 Cost 8320
\[-1 + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 + a \cdot -3\right)\right) + {\left(a \cdot a + b \cdot b\right)}^{2}\right)
\]
Alternative 4 Error 0.2 Cost 7812
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 3 \cdot 10^{-6}:\\
\;\;\;\;-1 + \left({a}^{4} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left({\left(a \cdot a + b \cdot b\right)}^{2} + b \cdot \left(4 \cdot b\right)\right)\\
\end{array}
\]
Alternative 5 Error 0.4 Cost 7688
\[\begin{array}{l}
t_0 := -1 + \left({\left(a \cdot a + b \cdot b\right)}^{2} + b \cdot \left(4 \cdot b\right)\right)\\
\mathbf{if}\;b \leq -0.0018449747198545498:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq 4.02 \cdot 10^{-19}:\\
\;\;\;\;-1 + a \cdot \left(b \cdot \left(b \cdot -12\right) + a \cdot \left(4 + a \cdot \left(4 + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 2.2 Cost 2760
\[\begin{array}{l}
t_0 := -1 + a \cdot \left(b \cdot \left(b \cdot -12\right) + a \cdot \left(4 + a \cdot \left(4 + a\right)\right)\right)\\
\mathbf{if}\;a \leq -164235.85908825533:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 60195.97999073543:\\
\;\;\;\;-1 + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 + a \cdot -3\right)\right) + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(a \cdot \left(a \cdot 2\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 7 Error 2.0 Cost 1608
\[\begin{array}{l}
t_0 := -1 + a \cdot \left(b \cdot \left(b \cdot -12\right) + a \cdot \left(4 + a \cdot \left(4 + a\right)\right)\right)\\
\mathbf{if}\;a \leq -9.957393309110197 \cdot 10^{-9}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 8.85656691015874 \cdot 10^{-26}:\\
\;\;\;\;-1 + \left(b \cdot \left(4 \cdot b\right) + b \cdot \left(b \cdot \left(b \cdot b + a \cdot \left(a + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 8 Error 2.0 Cost 1480
\[\begin{array}{l}
t_0 := -1 + a \cdot \left(b \cdot \left(b \cdot -12\right) + a \cdot \left(4 + a \cdot \left(4 + a\right)\right)\right)\\
\mathbf{if}\;a \leq -9.957393309110197 \cdot 10^{-9}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 8.85656691015874 \cdot 10^{-26}:\\
\;\;\;\;-1 + \left(b \cdot \left(4 \cdot b\right) + b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 9 Error 12.5 Cost 960
\[-1 + \left(b \cdot \left(4 \cdot b\right) + b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)
\]
Alternative 10 Error 23.0 Cost 448
\[-1 + 4 \cdot \left(b \cdot b\right)
\]
Alternative 11 Error 23.9 Cost 64
\[-1
\]