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
\]
↓
\[\mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, a + 3, a \cdot a\right) - {a}^{3}, {\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + -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
(fma
4.0
(- (fma (* b b) (+ a 3.0) (* a a)) (pow a 3.0))
(+ (pow (hypot a b) 4.0) -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 fma(4.0, (fma((b * b), (a + 3.0), (a * a)) - pow(a, 3.0)), (pow(hypot(a, 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(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(3.0 + a))))) - 1.0)
end
↓
function code(a, b)
return fma(4.0, Float64(fma(Float64(b * b), Float64(a + 3.0), Float64(a * a)) - (a ^ 3.0)), Float64((hypot(a, 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[(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[(4.0 * N[(N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision] - N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 4.0], $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
↓
\mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, a + 3, a \cdot a\right) - {a}^{3}, {\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + -1\right)
Alternatives Alternative 1 Error 0.17% Cost 20864
\[-1 + \left(\mathsf{hypot}\left(b, a\right) \cdot {\left(\mathsf{hypot}\left(b, a\right)\right)}^{3} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\right)
\]
Alternative 2 Error 0.3% Cost 20736
\[{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(-1 + 4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\right)
\]
Alternative 3 Error 0.31% Cost 8196
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-13}:\\
\;\;\;\;-1 + \left({a}^{4} + 4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left({\left(b \cdot b + a \cdot a\right)}^{2} + 4 \cdot \left(a \cdot a + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\right)\\
\end{array}
\]
Alternative 4 Error 0.29% Cost 8192
\[-1 + \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) + {\left(b \cdot b + a \cdot a\right)}^{2}\right)
\]
Alternative 5 Error 2.45% Cost 7560
\[\begin{array}{l}
t_0 := -1 + {b}^{4}\\
\mathbf{if}\;b \leq -8 \cdot 10^{-6}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 \cdot \left(a + 3\right)\right) + t_0\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-7}:\\
\;\;\;\;-1 + a \cdot \left({a}^{3} + \left(1 - a\right) \cdot \left(4 \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + b \cdot \left(b \cdot 12\right)\\
\end{array}
\]
Alternative 6 Error 2.37% Cost 7560
\[\begin{array}{l}
t_0 := -1 + {b}^{4}\\
\mathbf{if}\;b \leq -9 \cdot 10^{-7}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 \cdot \left(a + 3\right)\right) + t_0\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{-5}:\\
\;\;\;\;-1 + \left({a}^{4} + 4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + b \cdot \left(b \cdot 12\right)\\
\end{array}
\]
Alternative 7 Error 3.78% Cost 7432
\[\begin{array}{l}
t_0 := -1 + {b}^{4}\\
\mathbf{if}\;b \leq -8.6 \cdot 10^{-7}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 \cdot \left(a + 3\right)\right) + t_0\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-7}:\\
\;\;\;\;-1 + \left({a}^{4} + -4 \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + b \cdot \left(b \cdot 12\right)\\
\end{array}
\]
Alternative 8 Error 3.79% Cost 7428
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-13}:\\
\;\;\;\;-1 + \left({a}^{4} + -4 \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + {b}^{4}\right) + b \cdot \left(b \cdot 12\right)\\
\end{array}
\]
Alternative 9 Error 3.83% Cost 7300
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-13}:\\
\;\;\;\;-1 + {a}^{3} \cdot \left(a + -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1 + {b}^{4}\right) + b \cdot \left(b \cdot 12\right)\\
\end{array}
\]
Alternative 10 Error 3.92% Cost 7236
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-13}:\\
\;\;\;\;-1 + {a}^{3} \cdot \left(a + -4\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 12\right)\right)\\
\end{array}
\]
Alternative 11 Error 3.96% Cost 7172
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-13}:\\
\;\;\;\;-1 + {a}^{3} \cdot \left(a + -4\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot 12\right)\\
\end{array}
\]
Alternative 12 Error 4.57% Cost 6916
\[\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-13}:\\
\;\;\;\;-1 + {a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot 12\right)\\
\end{array}
\]
Alternative 13 Error 5.11% Cost 6793
\[\begin{array}{l}
\mathbf{if}\;a \leq -7.1 \cdot 10^{+22} \lor \neg \left(a \leq 2.7\right):\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot 12\right)\\
\end{array}
\]
Alternative 14 Error 5.21% Cost 1225
\[\begin{array}{l}
\mathbf{if}\;a \leq -7.1 \cdot 10^{+22} \lor \neg \left(a \leq 3.7\right):\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot 12\right)\\
\end{array}
\]
Alternative 15 Error 6.76% Cost 841
\[\begin{array}{l}
\mathbf{if}\;a \leq -7.1 \cdot 10^{+22} \lor \neg \left(a \leq 3.8\right):\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot \left(b \cdot b\right)\\
\end{array}
\]
Alternative 16 Error 20.72% Cost 713
\[\begin{array}{l}
\mathbf{if}\;a \leq -0.42 \lor \neg \left(a \leq 0.001\right):\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 17 Error 19.19% Cost 713
\[\begin{array}{l}
\mathbf{if}\;a \leq -0.42 \lor \neg \left(a \leq 2.4\right):\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(b \cdot b\right) \cdot 12\\
\end{array}
\]
Alternative 18 Error 36.32% Cost 64
\[-1
\]