?

Average Accuracy: 39.9% → 40.0%
Time: 9.0s
Precision: binary64
Cost: 13504

?

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

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(b \cdot b\right)\right) - 1 \]
  2. Applied egg-rr40.0%

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

    [Start]39.9

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

    add-log-exp [=>]25.8

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

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

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

    log-prod [=>]25.8

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

    metadata-eval [=>]25.8

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

    add-log-exp [<=]39.9

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

    add-sqr-sqrt [=>]39.9

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

    unpow-prod-down [=>]39.9

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

    pow-prod-up [=>]40.0

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

    hypot-def [=>]40.0

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

    metadata-eval [=>]40.0

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

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

    [Start]40.0

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

    +-lft-identity [=>]40.0

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

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

Alternatives

Alternative 1
Accuracy39.9%
Cost7424
\[\left(4 \cdot \left(b \cdot b\right) + {\left(b \cdot b + a \cdot a\right)}^{2}\right) + -1 \]
Alternative 2
Accuracy38.0%
Cost7305
\[\begin{array}{l} t_0 := 4 \cdot \left(b \cdot b\right)\\ \mathbf{if}\;a \leq -125000000 \lor \neg \left(a \leq 1.6 \cdot 10^{-101}\right):\\ \;\;\;\;\left(t_0 + {a}^{4}\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 + \left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) + -1\\ \end{array} \]
Alternative 3
Accuracy38.0%
Cost7305
\[\begin{array}{l} t_0 := 4 \cdot \left(b \cdot b\right)\\ \mathbf{if}\;a \leq -125000000 \lor \neg \left(a \leq 4 \cdot 10^{-101}\right):\\ \;\;\;\;\left(t_0 + {a}^{4}\right) + -1\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 + {b}^{4}\right) + -1\\ \end{array} \]
Alternative 4
Accuracy32.9%
Cost960
\[\left(4 \cdot \left(b \cdot b\right) + \left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) + -1 \]

Error

Reproduce?

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