?

Average Accuracy: 99.7% → 100.0%
Time: 10.5s
Precision: binary64
Cost: 14400

?

\[\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(1 - 3 \cdot a\right)\right)\right) - 1 \]
\[\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right)\right) + -1 \]
(FPCore (a b)
 :precision binary64
 (-
  (+
   (pow (+ (* a a) (* b b)) 2.0)
   (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a))))))
  1.0))
(FPCore (a b)
 :precision binary64
 (+
  (+
   (pow (hypot b a) 4.0)
   (* 4.0 (+ (* (* a a) (+ a 1.0)) (* (* b b) (- 1.0 (* a 3.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) * (1.0 - (3.0 * a)))))) - 1.0;
}
double code(double a, double b) {
	return (pow(hypot(b, a), 4.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.0)))))) + -1.0;
}
public static double code(double a, double b) {
	return (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
}
public static double code(double a, double b) {
	return (Math.pow(Math.hypot(b, a), 4.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.0)))))) + -1.0;
}
def code(a, b):
	return (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0
def code(a, b):
	return (math.pow(math.hypot(b, a), 4.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.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(1.0 - Float64(3.0 * a)))))) - 1.0)
end
function code(a, b)
	return Float64(Float64((hypot(b, a) ^ 4.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(a + 1.0)) + Float64(Float64(b * b) * Float64(1.0 - Float64(a * 3.0)))))) + -1.0)
end
function tmp = code(a, b)
	tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 + a)) + ((b * b) * (1.0 - (3.0 * a)))))) - 1.0;
end
function tmp = code(a, b)
	tmp = ((hypot(b, a) ^ 4.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.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[(1.0 - N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
code[a_, b_] := N[(N[(N[Power[N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision], 4.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(a + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(1.0 - N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $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(1 - 3 \cdot a\right)\right)\right) - 1
\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right)\right) + -1

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.7%

    \[\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(1 - 3 \cdot a\right)\right)\right) - 1 \]
  2. Applied egg-rr99.7%

    \[\leadsto \left(\color{blue}{\left(0 + {\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{2}\right)}^{2}\right)} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    Proof

    [Start]99.7

    \[ \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(1 - 3 \cdot a\right)\right)\right) - 1 \]

    add-log-exp [=>]64.4

    \[ \left(\color{blue}{\log \left(e^{{\left(a \cdot a + b \cdot b\right)}^{2}}\right)} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    *-un-lft-identity [=>]64.4

    \[ \left(\log \color{blue}{\left(1 \cdot e^{{\left(a \cdot a + b \cdot b\right)}^{2}}\right)} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    log-prod [=>]64.4

    \[ \left(\color{blue}{\left(\log 1 + \log \left(e^{{\left(a \cdot a + b \cdot b\right)}^{2}}\right)\right)} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    metadata-eval [=>]64.4

    \[ \left(\left(\color{blue}{0} + \log \left(e^{{\left(a \cdot a + b \cdot b\right)}^{2}}\right)\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    add-log-exp [<=]99.7

    \[ \left(\left(0 + \color{blue}{{\left(a \cdot a + b \cdot b\right)}^{2}}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    add-sqr-sqrt [=>]99.7

    \[ \left(\left(0 + {\color{blue}{\left(\sqrt{a \cdot a + b \cdot b} \cdot \sqrt{a \cdot a + b \cdot b}\right)}}^{2}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    pow2 [=>]99.7

    \[ \left(\left(0 + {\color{blue}{\left({\left(\sqrt{a \cdot a + b \cdot b}\right)}^{2}\right)}}^{2}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    +-commutative [=>]99.7

    \[ \left(\left(0 + {\left({\left(\sqrt{\color{blue}{b \cdot b + a \cdot a}}\right)}^{2}\right)}^{2}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    hypot-def [=>]99.7

    \[ \left(\left(0 + {\left({\color{blue}{\left(\mathsf{hypot}\left(b, a\right)\right)}}^{2}\right)}^{2}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
  3. Simplified100.0%

    \[\leadsto \left(\color{blue}{{\left(\mathsf{hypot}\left(b, a\right)\right)}^{4}} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
    Proof

    [Start]99.7

    \[ \left(\left(0 + {\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{2}\right)}^{2}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    +-lft-identity [=>]99.7

    \[ \left(\color{blue}{{\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{2}\right)}^{2}} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    unpow2 [=>]99.7

    \[ \left(\color{blue}{{\left(\mathsf{hypot}\left(b, a\right)\right)}^{2} \cdot {\left(\mathsf{hypot}\left(b, a\right)\right)}^{2}} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    pow-sqr [=>]100.0

    \[ \left(\color{blue}{{\left(\mathsf{hypot}\left(b, a\right)\right)}^{\left(2 \cdot 2\right)}} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]

    metadata-eval [=>]100.0

    \[ \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{\color{blue}{4}} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1 \]
  4. Final simplification100.0%

    \[\leadsto \left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right)\right) + -1 \]

Alternatives

Alternative 1
Accuracy99.9%
Cost14016
\[\left({\left(\mathsf{hypot}\left(b, a\right)\right)}^{4} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + b \cdot b\right)\right) + -1 \]
Alternative 2
Accuracy97.6%
Cost2377
\[\begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-6} \lor \neg \left(a \leq 0.0007\right):\\ \;\;\;\;\left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right) + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot b\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + 4 \cdot \left(b \cdot b\right)\right) + -1\\ \end{array} \]
Alternative 3
Accuracy97.9%
Cost2377
\[\begin{array}{l} t_0 := a \cdot a + b \cdot b\\ t_1 := 4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right)\\ \mathbf{if}\;a \leq -0.00065 \lor \neg \left(a \leq 0.0017\right):\\ \;\;\;\;\left(t_1 + \left(a \cdot a\right) \cdot t_0\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(t_1 + \left(b \cdot b\right) \cdot t_0\right) + -1\\ \end{array} \]
Alternative 4
Accuracy99.7%
Cost2368
\[\begin{array}{l} t_0 := a \cdot a + b \cdot b\\ \left(4 \cdot \left(\left(a \cdot a\right) \cdot \left(a + 1\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right) + t_0 \cdot t_0\right) + -1 \end{array} \]
Alternative 5
Accuracy95.7%
Cost1224
\[\begin{array}{l} \mathbf{if}\;a \leq -0.0095:\\ \;\;\;\;\left(a \cdot a + 1\right) \cdot \left(a \cdot a + -1\right)\\ \mathbf{elif}\;a \leq 170:\\ \;\;\;\;\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + 4 \cdot \left(b \cdot b\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right) + -1\\ \end{array} \]
Alternative 6
Accuracy79.6%
Cost713
\[\begin{array}{l} \mathbf{if}\;a \leq -2.4 \lor \neg \left(a \leq 0.235\right):\\ \;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 7
Accuracy80.9%
Cost713
\[\begin{array}{l} \mathbf{if}\;a \leq -2.4 \lor \neg \left(a \leq 0.42\right):\\ \;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;4 \cdot \left(b \cdot b\right) + -1\\ \end{array} \]
Alternative 8
Accuracy79.6%
Cost704
\[\left(a \cdot a + 1\right) \cdot \left(a \cdot a + -1\right) \]
Alternative 9
Accuracy79.6%
Cost576
\[\left(a \cdot a\right) \cdot \left(a \cdot a\right) + -1 \]
Alternative 10
Accuracy63.0%
Cost64
\[-1 \]

Error

Reproduce?

herbie shell --seed 2023152 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (25)"
  :precision binary64
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a)))))) 1.0))