
(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))
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;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * (((a * a) * (1.0d0 + a)) + ((b * b) * (1.0d0 - (3.0d0 * a)))))) - 1.0d0
end function
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;
}
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
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 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
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]
\begin{array}{l}
\\
\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
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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))
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;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * (((a * a) * (1.0d0 + a)) + ((b * b) * (1.0d0 - (3.0d0 * a)))))) - 1.0d0
end function
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;
}
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
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 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
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]
\begin{array}{l}
\\
\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
\end{array}
(FPCore (a b)
:precision binary64
(let* ((t_0
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (+ a 1.0)) (* (* b b) (- 1.0 (* a 3.0))))))))
(if (<= t_0 INFINITY) (+ t_0 -1.0) (pow a 4.0))))
double code(double a, double b) {
double t_0 = pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.0)))));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0 + -1.0;
} else {
tmp = pow(a, 4.0);
}
return tmp;
}
public static double code(double a, double b) {
double t_0 = Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.0)))));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0 + -1.0;
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): t_0 = math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.0))))) tmp = 0 if t_0 <= math.inf: tmp = t_0 + -1.0 else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) t_0 = Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(a + 1.0)) + Float64(Float64(b * b) * Float64(1.0 - Float64(a * 3.0)))))) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(t_0 + -1.0); else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) t_0 = (((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (a + 1.0)) + ((b * b) * (1.0 - (a * 3.0))))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0 + -1.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = 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[(a + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(1.0 - N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(a \cdot a + b \cdot b\right)}^{2} + 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}\;t_0 \leq \infty:\\
\;\;\;\;t_0 + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) 2) (*.f64 4 (+.f64 (*.f64 (*.f64 a a) (+.f64 1 a)) (*.f64 (*.f64 b b) (-.f64 1 (*.f64 3 a)))))) < +inf.0Initial program 99.9%
if +inf.0 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) 2) (*.f64 4 (+.f64 (*.f64 (*.f64 a a) (+.f64 1 a)) (*.f64 (*.f64 b b) (-.f64 1 (*.f64 3 a)))))) Initial program 0.0%
associate--l+0.0%
fma-def0.0%
Simplified7.9%
Taylor expanded in a around inf 94.0%
Final simplification98.4%
(FPCore (a b)
:precision binary64
(if (<= a -1e+65)
(pow a 4.0)
(if (<= a -1450.0)
(pow b 4.0)
(if (<= a 1.45e+68) (+ (* 4.0 (pow b 2.0)) -1.0) (pow a 4.0)))))
double code(double a, double b) {
double tmp;
if (a <= -1e+65) {
tmp = pow(a, 4.0);
} else if (a <= -1450.0) {
tmp = pow(b, 4.0);
} else if (a <= 1.45e+68) {
tmp = (4.0 * pow(b, 2.0)) + -1.0;
} else {
tmp = pow(a, 4.0);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1d+65)) then
tmp = a ** 4.0d0
else if (a <= (-1450.0d0)) then
tmp = b ** 4.0d0
else if (a <= 1.45d+68) then
tmp = (4.0d0 * (b ** 2.0d0)) + (-1.0d0)
else
tmp = a ** 4.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -1e+65) {
tmp = Math.pow(a, 4.0);
} else if (a <= -1450.0) {
tmp = Math.pow(b, 4.0);
} else if (a <= 1.45e+68) {
tmp = (4.0 * Math.pow(b, 2.0)) + -1.0;
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -1e+65: tmp = math.pow(a, 4.0) elif a <= -1450.0: tmp = math.pow(b, 4.0) elif a <= 1.45e+68: tmp = (4.0 * math.pow(b, 2.0)) + -1.0 else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) tmp = 0.0 if (a <= -1e+65) tmp = a ^ 4.0; elseif (a <= -1450.0) tmp = b ^ 4.0; elseif (a <= 1.45e+68) tmp = Float64(Float64(4.0 * (b ^ 2.0)) + -1.0); else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -1e+65) tmp = a ^ 4.0; elseif (a <= -1450.0) tmp = b ^ 4.0; elseif (a <= 1.45e+68) tmp = (4.0 * (b ^ 2.0)) + -1.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -1e+65], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, -1450.0], N[Power[b, 4.0], $MachinePrecision], If[LessEqual[a, 1.45e+68], N[(N[(4.0 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+65}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq -1450:\\
\;\;\;\;{b}^{4}\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+68}:\\
\;\;\;\;4 \cdot {b}^{2} + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -9.9999999999999999e64 or 1.45000000000000006e68 < a Initial program 43.2%
associate--l+43.2%
fma-def43.2%
Simplified48.0%
Taylor expanded in a around inf 100.0%
if -9.9999999999999999e64 < a < -1450Initial program 99.5%
associate--l+99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in b around inf 69.6%
if -1450 < a < 1.45000000000000006e68Initial program 97.0%
associate--l+97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in a around 0 99.2%
Taylor expanded in b around 0 80.2%
Final simplification87.6%
(FPCore (a b)
:precision binary64
(if (<= a -5.2e+64)
(pow a 4.0)
(if (<= a -1450.0)
(pow b 4.0)
(if (<= a 8.5e+69)
(* (+ 1.0 (* b 2.0)) (+ (* b 2.0) -1.0))
(pow a 4.0)))))
double code(double a, double b) {
double tmp;
if (a <= -5.2e+64) {
tmp = pow(a, 4.0);
} else if (a <= -1450.0) {
tmp = pow(b, 4.0);
} else if (a <= 8.5e+69) {
tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0);
} else {
tmp = pow(a, 4.0);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-5.2d+64)) then
tmp = a ** 4.0d0
else if (a <= (-1450.0d0)) then
tmp = b ** 4.0d0
else if (a <= 8.5d+69) then
tmp = (1.0d0 + (b * 2.0d0)) * ((b * 2.0d0) + (-1.0d0))
else
tmp = a ** 4.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -5.2e+64) {
tmp = Math.pow(a, 4.0);
} else if (a <= -1450.0) {
tmp = Math.pow(b, 4.0);
} else if (a <= 8.5e+69) {
tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0);
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -5.2e+64: tmp = math.pow(a, 4.0) elif a <= -1450.0: tmp = math.pow(b, 4.0) elif a <= 8.5e+69: tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0) else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) tmp = 0.0 if (a <= -5.2e+64) tmp = a ^ 4.0; elseif (a <= -1450.0) tmp = b ^ 4.0; elseif (a <= 8.5e+69) tmp = Float64(Float64(1.0 + Float64(b * 2.0)) * Float64(Float64(b * 2.0) + -1.0)); else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -5.2e+64) tmp = a ^ 4.0; elseif (a <= -1450.0) tmp = b ^ 4.0; elseif (a <= 8.5e+69) tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0); else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -5.2e+64], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, -1450.0], N[Power[b, 4.0], $MachinePrecision], If[LessEqual[a, 8.5e+69], N[(N[(1.0 + N[(b * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(b * 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{+64}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq -1450:\\
\;\;\;\;{b}^{4}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+69}:\\
\;\;\;\;\left(1 + b \cdot 2\right) \cdot \left(b \cdot 2 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -5.19999999999999994e64 or 8.5000000000000002e69 < a Initial program 43.2%
associate--l+43.2%
fma-def43.2%
Simplified48.0%
Taylor expanded in a around inf 100.0%
if -5.19999999999999994e64 < a < -1450Initial program 99.5%
associate--l+99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in b around inf 69.6%
if -1450 < a < 8.5000000000000002e69Initial program 97.0%
associate--l+97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in a around 0 99.2%
Taylor expanded in b around 0 80.2%
add-sqr-sqrt80.2%
difference-of-sqr-180.2%
sqrt-prod80.2%
metadata-eval80.2%
unpow280.2%
sqrt-prod32.1%
add-sqr-sqrt58.4%
sqrt-prod58.4%
metadata-eval58.4%
unpow258.4%
sqrt-prod32.1%
add-sqr-sqrt80.2%
Applied egg-rr80.2%
Final simplification87.6%
(FPCore (a b) :precision binary64 (if (or (<= a -6e+34) (not (<= a 6.6e+67))) (pow a 4.0) (* (+ 1.0 (* b 2.0)) (+ (* b 2.0) -1.0))))
double code(double a, double b) {
double tmp;
if ((a <= -6e+34) || !(a <= 6.6e+67)) {
tmp = pow(a, 4.0);
} else {
tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6d+34)) .or. (.not. (a <= 6.6d+67))) then
tmp = a ** 4.0d0
else
tmp = (1.0d0 + (b * 2.0d0)) * ((b * 2.0d0) + (-1.0d0))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((a <= -6e+34) || !(a <= 6.6e+67)) {
tmp = Math.pow(a, 4.0);
} else {
tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0);
}
return tmp;
}
def code(a, b): tmp = 0 if (a <= -6e+34) or not (a <= 6.6e+67): tmp = math.pow(a, 4.0) else: tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0) return tmp
function code(a, b) tmp = 0.0 if ((a <= -6e+34) || !(a <= 6.6e+67)) tmp = a ^ 4.0; else tmp = Float64(Float64(1.0 + Float64(b * 2.0)) * Float64(Float64(b * 2.0) + -1.0)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((a <= -6e+34) || ~((a <= 6.6e+67))) tmp = a ^ 4.0; else tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0); end tmp_2 = tmp; end
code[a_, b_] := If[Or[LessEqual[a, -6e+34], N[Not[LessEqual[a, 6.6e+67]], $MachinePrecision]], N[Power[a, 4.0], $MachinePrecision], N[(N[(1.0 + N[(b * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(b * 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+34} \lor \neg \left(a \leq 6.6 \cdot 10^{+67}\right):\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + b \cdot 2\right) \cdot \left(b \cdot 2 + -1\right)\\
\end{array}
\end{array}
if a < -6.00000000000000037e34 or 6.6000000000000006e67 < a Initial program 46.8%
associate--l+46.8%
fma-def46.8%
Simplified51.3%
Taylor expanded in a around inf 96.6%
if -6.00000000000000037e34 < a < 6.6000000000000006e67Initial program 97.1%
associate--l+97.1%
fma-def97.1%
Simplified97.1%
Taylor expanded in a around 0 97.9%
Taylor expanded in b around 0 76.8%
add-sqr-sqrt76.8%
difference-of-sqr-176.8%
sqrt-prod76.8%
metadata-eval76.8%
unpow276.8%
sqrt-prod30.2%
add-sqr-sqrt54.8%
sqrt-prod54.8%
metadata-eval54.8%
unpow254.8%
sqrt-prod30.2%
add-sqr-sqrt76.8%
Applied egg-rr76.8%
Final simplification85.4%
(FPCore (a b) :precision binary64 (* (+ 1.0 (* b 2.0)) (+ (* b 2.0) -1.0)))
double code(double a, double b) {
return (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0);
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (1.0d0 + (b * 2.0d0)) * ((b * 2.0d0) + (-1.0d0))
end function
public static double code(double a, double b) {
return (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0);
}
def code(a, b): return (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0)
function code(a, b) return Float64(Float64(1.0 + Float64(b * 2.0)) * Float64(Float64(b * 2.0) + -1.0)) end
function tmp = code(a, b) tmp = (1.0 + (b * 2.0)) * ((b * 2.0) + -1.0); end
code[a_, b_] := N[(N[(1.0 + N[(b * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(b * 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + b \cdot 2\right) \cdot \left(b \cdot 2 + -1\right)
\end{array}
Initial program 75.3%
associate--l+75.3%
fma-def75.3%
Simplified77.3%
Taylor expanded in a around 0 73.9%
Taylor expanded in b around 0 56.0%
add-sqr-sqrt56.0%
difference-of-sqr-156.0%
sqrt-prod56.0%
metadata-eval56.0%
unpow256.0%
sqrt-prod24.6%
add-sqr-sqrt38.6%
sqrt-prod38.6%
metadata-eval38.6%
unpow238.6%
sqrt-prod24.6%
add-sqr-sqrt56.0%
Applied egg-rr56.0%
Final simplification56.0%
(FPCore (a b) :precision binary64 -1.0)
double code(double a, double b) {
return -1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = -1.0d0
end function
public static double code(double a, double b) {
return -1.0;
}
def code(a, b): return -1.0
function code(a, b) return -1.0 end
function tmp = code(a, b) tmp = -1.0; end
code[a_, b_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 75.3%
associate--l+75.3%
fma-def75.3%
Simplified77.3%
Taylor expanded in a around 0 73.9%
Taylor expanded in b around 0 25.0%
Final simplification25.0%
herbie shell --seed 2023301
(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))