Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\]
↓
\[\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + 4 \cdot \left(b \cdot b\right)\right) + -1
\]
(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) (* 4.0 (* b b))) -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) + (4.0 * (b * b))) + -1.0;
}
public static double code(double a, double b) {
return (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (b * b))) - 1.0;
}
↓
public static double code(double a, double b) {
return (Math.pow(Math.hypot(a, b), 4.0) + (4.0 * (b * b))) + -1.0;
}
def code(a, b):
return (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (b * b))) - 1.0
↓
def code(a, b):
return (math.pow(math.hypot(a, b), 4.0) + (4.0 * (b * b))) + -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(Float64((hypot(a, b) ^ 4.0) + Float64(4.0 * Float64(b * b))) + -1.0)
end
function tmp = code(a, b)
tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (b * b))) - 1.0;
end
↓
function tmp = code(a, b)
tmp = ((hypot(a, b) ^ 4.0) + (4.0 * (b * b))) + -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[(N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(4.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
↓
\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + 4 \cdot \left(b \cdot b\right)\right) + -1
Alternatives Alternative 1 Error 0.2 Cost 7424
\[\left(4 \cdot \left(b \cdot b\right) + {\left(b \cdot b + a \cdot a\right)}^{2}\right) + -1
\]
Alternative 2 Error 1.7 Cost 7304
\[\begin{array}{l}
t_0 := 4 \cdot \left(b \cdot b\right)\\
\mathbf{if}\;a \leq -17.153522983836687:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{elif}\;a \leq 1.3944229888794467 \cdot 10^{-24}:\\
\;\;\;\;\left(t_0 + {b}^{4}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot \left(b + b\right)\right)\right) + -1\\
\end{array}
\]
Alternative 3 Error 1.8 Cost 7240
\[\begin{array}{l}
\mathbf{if}\;a \leq -17.153522983836687:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{elif}\;a \leq 1.3944229888794467 \cdot 10^{-24}:\\
\;\;\;\;b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(4 \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot \left(b + b\right)\right)\right) + -1\\
\end{array}
\]
Alternative 4 Error 1.8 Cost 6788
\[\begin{array}{l}
\mathbf{if}\;a \leq -17.153522983836687:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{elif}\;a \leq 1.3944229888794467 \cdot 10^{-24}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(4 \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot \left(b + b\right)\right)\right) + -1\\
\end{array}
\]
Alternative 5 Error 1.4 Cost 1604
\[\begin{array}{l}
\mathbf{if}\;a \cdot a \leq 0.0001:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(4 \cdot \left(b \cdot b\right) + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot \left(b + b\right)\right)\right) + -1\\
\end{array}
\]
Alternative 6 Error 1.5 Cost 964
\[\begin{array}{l}
\mathbf{if}\;a \cdot a \leq 5.822176789685848 \cdot 10^{-5}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right) + -1\\
\end{array}
\]
Alternative 7 Error 11.9 Cost 712
\[\begin{array}{l}
t_0 := \left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\mathbf{if}\;a \leq -17.153522983836687:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.8265576789974813 \cdot 10^{-6}:\\
\;\;\;\;b \cdot \left(b \cdot 4\right) + -1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 8 Error 12.6 Cost 708
\[\begin{array}{l}
\mathbf{if}\;a \cdot a \leq 7.581906572217904 \cdot 10^{-6}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\end{array}
\]
Alternative 9 Error 12.0 Cost 576
\[\left(a \cdot a\right) \cdot \left(a \cdot a\right) + -1
\]
Alternative 10 Error 23.9 Cost 64
\[-1
\]