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
\]
↓
\[{\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + \mathsf{fma}\left(b \cdot b, 4, -1\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 (hypot a b) 4.0) (fma (* b b) 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(hypot(a, b), 4.0) + fma((b * 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(b * b))) - 1.0)
end
↓
function code(a, b)
return Float64((hypot(a, b) ^ 4.0) + fma(Float64(b * 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[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
↓
code[a_, b_] := N[(N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * 4.0 + -1.0), $MachinePrecision]), $MachinePrecision]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
↓
{\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + \mathsf{fma}\left(b \cdot b, 4, -1\right)
Alternatives Alternative 1 Error 1.5 Cost 7625
\[\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \lor \neg \left(a \leq 0.00085\right):\\
\;\;\;\;-1 + {a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(b \cdot b + \mathsf{fma}\left(2, a \cdot a, 4\right)\right)\\
\end{array}
\]
Alternative 2 Error 0.2 Cost 7424
\[-1 + \left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right)
\]
Alternative 3 Error 1.4 Cost 7305
\[\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \lor \neg \left(a \leq 0.00065\right):\\
\;\;\;\;-1 + {a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(4 \cdot \left(b \cdot b\right) + {b}^{4}\right)\\
\end{array}
\]
Alternative 4 Error 1.5 Cost 7241
\[\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \lor \neg \left(a \leq 0.00095\right):\\
\;\;\;\;-1 + {a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right)\\
\end{array}
\]
Alternative 5 Error 1.5 Cost 6921
\[\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \lor \neg \left(a \leq 0.0033\right):\\
\;\;\;\;-1 + {a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\end{array}
\]
Alternative 6 Error 1.8 Cost 6660
\[\begin{array}{l}
\mathbf{if}\;a \leq -32000:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq 0.017:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a + 1\right) \cdot \left(-1 + a \cdot a\right)\\
\end{array}
\]
Alternative 7 Error 2.5 Cost 969
\[\begin{array}{l}
\mathbf{if}\;b \leq -75000 \lor \neg \left(b \leq 0.58\right):\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a + 1\right) \cdot \left(-1 + a \cdot a\right)\\
\end{array}
\]
Alternative 8 Error 1.6 Cost 969
\[\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \lor \neg \left(a \leq 0.0031\right):\\
\;\;\;\;\left(a \cdot a + 1\right) \cdot \left(-1 + a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\end{array}
\]
Alternative 9 Error 12.0 Cost 841
\[\begin{array}{l}
\mathbf{if}\;b \leq -0.95 \lor \neg \left(b \leq 0.95\right):\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot 4\right)\\
\end{array}
\]
Alternative 10 Error 22.8 Cost 448
\[-1 + b \cdot \left(b \cdot 4\right)
\]
Alternative 11 Error 23.8 Cost 64
\[-1
\]