Math FPCore C Julia Wolfram TeX \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\]
↓
\[{b}^{4} + \left({a}^{4} + \mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(2, a \cdot a, 4\right), -1\right)\right)
\]
(FPCore (a b)
:precision binary64
(- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0)) ↓
(FPCore (a b)
:precision binary64
(+ (pow b 4.0) (+ (pow a 4.0) (fma b (* b (fma 2.0 (* a a) 4.0)) -1.0)))) double code(double a, double b) {
return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (b * b))) - 1.0;
}
↓
double code(double a, double b) {
return pow(b, 4.0) + (pow(a, 4.0) + fma(b, (b * fma(2.0, (a * a), 4.0)), -1.0));
}
function code(a, b)
return Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(b * b))) - 1.0)
end
↓
function code(a, b)
return Float64((b ^ 4.0) + Float64((a ^ 4.0) + fma(b, Float64(b * fma(2.0, Float64(a * a), 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[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
↓
code[a_, b_] := N[(N[Power[b, 4.0], $MachinePrecision] + N[(N[Power[a, 4.0], $MachinePrecision] + N[(b * N[(b * N[(2.0 * N[(a * a), $MachinePrecision] + 4.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
↓
{b}^{4} + \left({a}^{4} + \mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(2, a \cdot a, 4\right), -1\right)\right)
Alternatives Alternative 1 Error 0.0 Cost 19776
\[{\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + \mathsf{fma}\left(b, b \cdot 4, -1\right)
\]
Alternative 2 Error 0.2 Cost 7424
\[-1 + \left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right)
\]
Alternative 3 Error 1.5 Cost 7300
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 4 \cdot 10^{-9}:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;-1 + \left({b}^{4} + 4 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\]
Alternative 4 Error 1.6 Cost 7236
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 4 \cdot 10^{-9}:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right)\\
\end{array}
\]
Alternative 5 Error 1.6 Cost 6916
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 4 \cdot 10^{-9}:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\end{array}
\]
Alternative 6 Error 2.2 Cost 6660
\[\begin{array}{l}
\mathbf{if}\;a \leq -460522.1364421929:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq 17265.122163642864:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(a \cdot a + 2 \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\]
Alternative 7 Error 2.1 Cost 1096
\[\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a + 2 \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{if}\;a \leq -460522.1364421929:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 17265.122163642864:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 8 Error 2.2 Cost 968
\[\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{if}\;a \leq -460522.1364421929:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 17265.122163642864:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 9 Error 3.2 Cost 840
\[\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{if}\;a \leq -460522.1364421929:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 17265.122163642864:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 10 Error 12.1 Cost 712
\[\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{if}\;a \leq -460522.1364421929:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.787956084833792 \cdot 10^{-5}:\\
\;\;\;\;-1 + 4 \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 11 Error 51.1 Cost 448
\[a \cdot \left(a \cdot \left(a \cdot a\right)\right)
\]