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} + b \cdot \left(b \cdot 4\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) (* 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) + (b * (b * 4.0))) + -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) + (b * (b * 4.0))) + -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) + (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(Float64((hypot(a, b) ^ 4.0) + Float64(b * Float64(b * 4.0))) + -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) + (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[(N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(b * N[(b * 4.0), $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} + b \cdot \left(b \cdot 4\right)\right) + -1
Alternatives Alternative 1 Error 1.5 Cost 7560
\[\begin{array}{l}
t_0 := 4 \cdot \left(b \cdot b\right)\\
\mathbf{if}\;b \leq -0.0017:\\
\;\;\;\;\left(t_0 + {b}^{4}\right) + -1\\
\mathbf{elif}\;b \leq 3.9:\\
\;\;\;\;\left(t_0 + {a}^{4}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;{b}^{4} + \left(b \cdot b\right) \cdot \left(4 + \left(a \cdot a\right) \cdot 2\right)\\
\end{array}
\]
Alternative 2 Error 0.2 Cost 7424
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) + -1
\]
Alternative 3 Error 1.8 Cost 7300
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10:\\
\;\;\;\;\left(4 \cdot \left(b \cdot b\right) + {a}^{4}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(b, b, 4\right) + -1\\
\end{array}
\]
Alternative 4 Error 1.7 Cost 7300
\[\begin{array}{l}
t_0 := 4 \cdot \left(b \cdot b\right)\\
\mathbf{if}\;b \cdot b \leq 10:\\
\;\;\;\;\left(t_0 + {a}^{4}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 + {b}^{4}\right) + -1\\
\end{array}
\]
Alternative 5 Error 2.0 Cost 7236
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(b, b, 4\right) + -1\\
\end{array}
\]
Alternative 6 Error 2.0 Cost 6916
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right) + -1\\
\end{array}
\]
Alternative 7 Error 13.0 Cost 836
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-18}:\\
\;\;\;\;b \cdot \left(b \cdot 4\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\end{array}
\]
Alternative 8 Error 12.5 Cost 713
\[\begin{array}{l}
\mathbf{if}\;b \leq -0.000295 \lor \neg \left(b \leq 1.95\right):\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot 4\right) + -1\\
\end{array}
\]
Alternative 9 Error 11.6 Cost 704
\[\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right) + -1
\]
Alternative 10 Error 51.3 Cost 448
\[\left(b \cdot b\right) \cdot \left(b \cdot b\right)
\]
Alternative 11 Error 61.7 Cost 320
\[b \cdot \left(b \cdot 4\right)
\]