?

Average Accuracy: 39.9% → 40.0%
Time: 11.0s
Precision: binary64
Cost: 14272

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 39.9%

    \[\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 \]
  2. Applied egg-rr38.7%

    \[\leadsto \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}\right)}^{2}\right)} - 1\right)} + 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 \]
    Proof

    [Start]39.9

    \[ \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 \]

    expm1-log1p-u [=>]38.7

    \[ \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\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(3 + a\right)\right)\right) - 1 \]

    expm1-udef [=>]38.7

    \[ \left(\color{blue}{\left(e^{\mathsf{log1p}\left({\left(a \cdot a + b \cdot b\right)}^{2}\right)} - 1\right)} + 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 \]

    add-sqr-sqrt [=>]38.7

    \[ \left(\left(e^{\mathsf{log1p}\left({\color{blue}{\left(\sqrt{a \cdot a + b \cdot b} \cdot \sqrt{a \cdot a + b \cdot b}\right)}}^{2}\right)} - 1\right) + 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 \]

    pow2 [=>]38.7

    \[ \left(\left(e^{\mathsf{log1p}\left({\color{blue}{\left({\left(\sqrt{a \cdot a + b \cdot b}\right)}^{2}\right)}}^{2}\right)} - 1\right) + 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 \]

    hypot-def [=>]38.7

    \[ \left(\left(e^{\mathsf{log1p}\left({\left({\color{blue}{\left(\mathsf{hypot}\left(a, b\right)\right)}}^{2}\right)}^{2}\right)} - 1\right) + 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 \]
  3. Simplified40.0%

    \[\leadsto \left(\color{blue}{{\left(\mathsf{hypot}\left(a, b\right)\right)}^{4}} + 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 \]
    Proof

    [Start]38.7

    \[ \left(\left(e^{\mathsf{log1p}\left({\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}\right)}^{2}\right)} - 1\right) + 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 \]

    expm1-def [=>]38.7

    \[ \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}\right)}^{2}\right)\right)} + 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 \]

    expm1-log1p [=>]39.9

    \[ \left(\color{blue}{{\left({\left(\mathsf{hypot}\left(a, b\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(3 + a\right)\right)\right) - 1 \]

    unpow2 [=>]39.9

    \[ \left(\color{blue}{{\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot {\left(\mathsf{hypot}\left(a, b\right)\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 \]

    pow-sqr [=>]40.0

    \[ \left(\color{blue}{{\left(\mathsf{hypot}\left(a, b\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(3 + a\right)\right)\right) - 1 \]

    metadata-eval [=>]40.0

    \[ \left({\left(\mathsf{hypot}\left(a, b\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(3 + a\right)\right)\right) - 1 \]
  4. Final simplification40.0%

    \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{4} + 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) + -1 \]

Alternatives

Alternative 1
Accuracy39.9%
Cost8192
\[\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(a \cdot a + b \cdot b\right)}^{2}\right) + -1 \]
Alternative 2
Accuracy37.9%
Cost7561
\[\begin{array}{l} \mathbf{if}\;a \leq -125000000 \lor \neg \left(a \leq 4.4 \cdot 10^{-101}\right):\\ \;\;\;\;\left({a}^{4} + \left(1 - a\right) \cdot \left(4 \cdot \left(a \cdot a\right)\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot \left(b \cdot 12\right) + {\left(b \cdot b\right)}^{2}\right) + -1\\ \end{array} \]
Alternative 3
Accuracy37.9%
Cost7561
\[\begin{array}{l} \mathbf{if}\;a \leq -125000000 \lor \neg \left(a \leq 4 \cdot 10^{-101}\right):\\ \;\;\;\;\left({a}^{4} + \left(1 - a\right) \cdot \left(4 \cdot \left(a \cdot a\right)\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left({b}^{4} + \left(b \cdot b\right) \cdot \left(12 + a \cdot 4\right)\right) + -1\\ \end{array} \]
Alternative 4
Accuracy37.9%
Cost7432
\[\begin{array}{l} \mathbf{if}\;a \leq -125000000:\\ \;\;\;\;{a}^{3} \cdot \left(a + -4\right)\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{-101}:\\ \;\;\;\;\left(b \cdot \left(b \cdot 12\right) + {\left(b \cdot b\right)}^{2}\right) + -1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(1 - a\right) \cdot \left(a \cdot 4\right) + a \cdot \left(a \cdot a\right)\right) + -1\\ \end{array} \]
Alternative 5
Accuracy39.0%
Cost7424
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + b \cdot \left(b \cdot 12\right)\right) + -1 \]
Alternative 6
Accuracy37.8%
Cost6916
\[\begin{array}{l} \mathbf{if}\;a \leq -180000000:\\ \;\;\;\;{a}^{3} \cdot \left(a + -4\right)\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{-101}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(12 + \left(b \cdot b + a \cdot 4\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\left(1 - a\right) \cdot \left(a \cdot 4\right) + a \cdot \left(a \cdot a\right)\right) + -1\\ \end{array} \]
Alternative 7
Accuracy37.9%
Cost1353
\[\begin{array}{l} \mathbf{if}\;a \leq -125000000 \lor \neg \left(a \leq 4.5 \cdot 10^{-101}\right):\\ \;\;\;\;a \cdot \left(\left(1 - a\right) \cdot \left(a \cdot 4\right) + a \cdot \left(a \cdot a\right)\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \left(12 + \left(b \cdot b + a \cdot 4\right)\right) + -1\\ \end{array} \]
Alternative 8
Accuracy32.8%
Cost960
\[\left(b \cdot b\right) \cdot \left(12 + \left(b \cdot b + a \cdot 4\right)\right) + -1 \]
Alternative 9
Accuracy26.8%
Cost448
\[4 \cdot \left(a \cdot a\right) + -1 \]
Alternative 10
Accuracy2.8%
Cost320
\[b \cdot \left(b \cdot 12\right) \]

Error

Reproduce?

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