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(3 + a\right)\right)\right) - 1
\]
↓
\[{\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + \mathsf{fma}\left(4, \left(a + 3\right) \cdot \left(b \cdot b\right) + a \cdot \left(a - a \cdot a\right), -1\right)
\]
(FPCore (a b)
:precision binary64
(-
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ 3.0 a)))))
1.0)) ↓
(FPCore (a b)
:precision binary64
(+
(pow (hypot a b) 4.0)
(fma 4.0 (+ (* (+ a 3.0) (* b b)) (* a (- a (* a a)))) -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) * (3.0 + a))))) - 1.0;
}
↓
double code(double a, double b) {
return pow(hypot(a, b), 4.0) + fma(4.0, (((a + 3.0) * (b * b)) + (a * (a - (a * a)))), -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(3.0 + a))))) - 1.0)
end
↓
function code(a, b)
return Float64((hypot(a, b) ^ 4.0) + fma(4.0, Float64(Float64(Float64(a + 3.0) * Float64(b * b)) + Float64(a * Float64(a - Float64(a * a)))), -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[(3.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
↓
code[a_, b_] := N[(N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a + 3.0), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(a * N[(a - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $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(3 + a\right)\right)\right) - 1
↓
{\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + \mathsf{fma}\left(4, \left(a + 3\right) \cdot \left(b \cdot b\right) + a \cdot \left(a - a \cdot a\right), -1\right)
Alternatives Alternative 1 Error 0.2 Cost 8192
\[-1 + \left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(\left(a + 3\right) \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \left(1 - a\right)\right)\right)
\]
Alternative 2 Error 1.0 Cost 8072
\[\begin{array}{l}
t_0 := -1 + \left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(a \cdot a + b \cdot \left(b \cdot 3\right)\right)\right)\\
\mathbf{if}\;b \leq -41274473.30685318:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq 1.613062509351647 \cdot 10^{-22}:\\
\;\;\;\;-1 + \left(\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + \left(b \cdot b\right) \cdot \left(a \cdot \left(4 + a \cdot 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 0.2 Cost 8064
\[-1 + \left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + b \cdot \left(b \cdot 3\right)\right)\right)
\]
Alternative 4 Error 2.1 Cost 7428
\[\begin{array}{l}
\mathbf{if}\;a \leq -0.006932719870971392:\\
\;\;\;\;-1 + \left(a \cdot \left(a \cdot 4\right) + \left(a + -4\right) \cdot {a}^{3}\right)\\
\mathbf{elif}\;a \leq 1.6254641905450022 \cdot 10^{-33}:\\
\;\;\;\;-1 + \left({b}^{4} + \left(b \cdot b\right) \cdot 12\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + \left(b \cdot b\right) \cdot \left(a \cdot \left(4 + a \cdot 2\right)\right)\right)\\
\end{array}
\]
Alternative 5 Error 2.1 Cost 7304
\[\begin{array}{l}
t_0 := -1 + \left(\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + \left(b \cdot b\right) \cdot \left(a \cdot \left(4 + a \cdot 2\right)\right)\right)\\
\mathbf{if}\;a \leq -0.006932719870971392:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.6254641905450022 \cdot 10^{-33}:\\
\;\;\;\;-1 + b \cdot \left({b}^{3} + b \cdot 12\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 2.0 Cost 7304
\[\begin{array}{l}
t_0 := -1 + \left(\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + \left(b \cdot b\right) \cdot \left(a \cdot \left(4 + a \cdot 2\right)\right)\right)\\
\mathbf{if}\;a \leq -0.006932719870971392:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.6254641905450022 \cdot 10^{-33}:\\
\;\;\;\;-1 + \left({b}^{4} + \left(b \cdot b\right) \cdot 12\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 7 Error 2.1 Cost 7240
\[\begin{array}{l}
t_0 := -1 + \left(\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + \left(b \cdot b\right) \cdot \left(a \cdot \left(4 + a \cdot 2\right)\right)\right)\\
\mathbf{if}\;a \leq -0.006932719870971392:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.6254641905450022 \cdot 10^{-33}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 8 Error 2.1 Cost 1864
\[\begin{array}{l}
t_0 := -1 + \left(\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + \left(b \cdot b\right) \cdot \left(a \cdot \left(4 + a \cdot 2\right)\right)\right)\\
\mathbf{if}\;a \leq -0.006932719870971392:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.6254641905450022 \cdot 10^{-33}:\\
\;\;\;\;-1 + \left(\left(b \cdot b\right) \cdot 12 + \left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 9 Error 2.2 Cost 1224
\[\begin{array}{l}
t_0 := -1 + \left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right)\\
\mathbf{if}\;a \leq -0.006932719870971392:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.6254641905450022 \cdot 10^{-33}:\\
\;\;\;\;-1 + \left(\left(b \cdot b\right) \cdot 12 + \left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 10 Error 12.2 Cost 832
\[-1 + \left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right)
\]
Alternative 11 Error 13.5 Cost 704
\[-1 + \left(a \cdot a\right) \cdot \left(4 + a \cdot a\right)
\]
Alternative 12 Error 22.7 Cost 448
\[-1 + \left(b \cdot b\right) \cdot 12
\]
Alternative 13 Error 23.7 Cost 64
\[-1
\]