
(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))
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;
}
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) * (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) * (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) * (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(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) * (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[(3.0 + a), $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(3 + 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) (+ 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) * (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) * (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) * (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) * (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(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) * (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[(3.0 + a), $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(3 + 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) (- 1.0 a)) (* (* b b) (+ a 3.0)))))))
(if (<= t_0 INFINITY) (+ t_0 -1.0) (+ (pow a 4.0) -1.0))))
double code(double a, double b) {
double t_0 = pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0 + -1.0;
} else {
tmp = pow(a, 4.0) + -1.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) * (1.0 - a)) + ((b * b) * (a + 3.0))));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0 + -1.0;
} else {
tmp = Math.pow(a, 4.0) + -1.0;
}
return tmp;
}
def code(a, b): t_0 = math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0)))) tmp = 0 if t_0 <= math.inf: tmp = t_0 + -1.0 else: tmp = math.pow(a, 4.0) + -1.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(1.0 - a)) + Float64(Float64(b * b) * Float64(a + 3.0))))) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(t_0 + -1.0); else tmp = Float64((a ^ 4.0) + -1.0); end return tmp end
function tmp_2 = code(a, b) t_0 = (((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0)))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0 + -1.0; else tmp = (a ^ 4.0) + -1.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[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 + -1.0), $MachinePrecision], N[(N[Power[a, 4.0], $MachinePrecision] + -1.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(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0 + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4} + -1\\
\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 3 a))))) < +inf.0Initial program 99.8%
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 3 a))))) Initial program 0.0%
associate--l+0.0%
sqr-pow0.0%
sqr-pow0.0%
fma-define0.0%
sqr-neg0.0%
Simplified5.5%
Taylor expanded in b around 0 35.8%
Taylor expanded in a around inf 94.7%
Final simplification98.4%
(FPCore (a b)
:precision binary64
(if (<= a -2.4e+33)
(pow a 4.0)
(if (<= a -0.0132)
(pow b 4.0)
(if (<= a -3.65e-169)
-1.0
(if (<= a -7.5e-242)
(pow b 4.0)
(if (<= a 3.8e-298)
-1.0
(if (<= a 2.2e+22) (pow b 4.0) (pow a 4.0))))))))
double code(double a, double b) {
double tmp;
if (a <= -2.4e+33) {
tmp = pow(a, 4.0);
} else if (a <= -0.0132) {
tmp = pow(b, 4.0);
} else if (a <= -3.65e-169) {
tmp = -1.0;
} else if (a <= -7.5e-242) {
tmp = pow(b, 4.0);
} else if (a <= 3.8e-298) {
tmp = -1.0;
} else if (a <= 2.2e+22) {
tmp = pow(b, 4.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 <= (-2.4d+33)) then
tmp = a ** 4.0d0
else if (a <= (-0.0132d0)) then
tmp = b ** 4.0d0
else if (a <= (-3.65d-169)) then
tmp = -1.0d0
else if (a <= (-7.5d-242)) then
tmp = b ** 4.0d0
else if (a <= 3.8d-298) then
tmp = -1.0d0
else if (a <= 2.2d+22) then
tmp = b ** 4.0d0
else
tmp = a ** 4.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -2.4e+33) {
tmp = Math.pow(a, 4.0);
} else if (a <= -0.0132) {
tmp = Math.pow(b, 4.0);
} else if (a <= -3.65e-169) {
tmp = -1.0;
} else if (a <= -7.5e-242) {
tmp = Math.pow(b, 4.0);
} else if (a <= 3.8e-298) {
tmp = -1.0;
} else if (a <= 2.2e+22) {
tmp = Math.pow(b, 4.0);
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -2.4e+33: tmp = math.pow(a, 4.0) elif a <= -0.0132: tmp = math.pow(b, 4.0) elif a <= -3.65e-169: tmp = -1.0 elif a <= -7.5e-242: tmp = math.pow(b, 4.0) elif a <= 3.8e-298: tmp = -1.0 elif a <= 2.2e+22: tmp = math.pow(b, 4.0) else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) tmp = 0.0 if (a <= -2.4e+33) tmp = a ^ 4.0; elseif (a <= -0.0132) tmp = b ^ 4.0; elseif (a <= -3.65e-169) tmp = -1.0; elseif (a <= -7.5e-242) tmp = b ^ 4.0; elseif (a <= 3.8e-298) tmp = -1.0; elseif (a <= 2.2e+22) tmp = b ^ 4.0; else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -2.4e+33) tmp = a ^ 4.0; elseif (a <= -0.0132) tmp = b ^ 4.0; elseif (a <= -3.65e-169) tmp = -1.0; elseif (a <= -7.5e-242) tmp = b ^ 4.0; elseif (a <= 3.8e-298) tmp = -1.0; elseif (a <= 2.2e+22) tmp = b ^ 4.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -2.4e+33], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, -0.0132], N[Power[b, 4.0], $MachinePrecision], If[LessEqual[a, -3.65e-169], -1.0, If[LessEqual[a, -7.5e-242], N[Power[b, 4.0], $MachinePrecision], If[LessEqual[a, 3.8e-298], -1.0, If[LessEqual[a, 2.2e+22], N[Power[b, 4.0], $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+33}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq -0.0132:\\
\;\;\;\;{b}^{4}\\
\mathbf{elif}\;a \leq -3.65 \cdot 10^{-169}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-242}:\\
\;\;\;\;{b}^{4}\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-298}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{+22}:\\
\;\;\;\;{b}^{4}\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -2.4e33 or 2.2e22 < a Initial program 37.1%
associate--l+37.1%
sqr-pow37.1%
sqr-pow37.1%
fma-define37.1%
sqr-neg37.1%
Simplified40.8%
Taylor expanded in a around inf 96.6%
if -2.4e33 < a < -0.0132 or -3.65e-169 < a < -7.4999999999999998e-242 or 3.8e-298 < a < 2.2e22Initial program 95.8%
associate--l+95.8%
sqr-pow95.8%
sqr-pow95.8%
fma-define95.8%
sqr-neg95.8%
Simplified95.8%
Taylor expanded in b around inf 61.4%
if -0.0132 < a < -3.65e-169 or -7.4999999999999998e-242 < a < 3.8e-298Initial program 99.9%
associate--l+99.9%
sqr-pow99.9%
sqr-pow99.9%
fma-define99.9%
sqr-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 88.0%
Taylor expanded in b around inf 94.1%
Taylor expanded in b around 0 66.9%
Final simplification77.5%
(FPCore (a b) :precision binary64 (if (<= a -1.7e+32) (pow a 4.0) (if (<= a 2.15e+22) (+ (pow b 4.0) -1.0) (+ (pow a 4.0) -1.0))))
double code(double a, double b) {
double tmp;
if (a <= -1.7e+32) {
tmp = pow(a, 4.0);
} else if (a <= 2.15e+22) {
tmp = pow(b, 4.0) + -1.0;
} else {
tmp = pow(a, 4.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 <= (-1.7d+32)) then
tmp = a ** 4.0d0
else if (a <= 2.15d+22) then
tmp = (b ** 4.0d0) + (-1.0d0)
else
tmp = (a ** 4.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -1.7e+32) {
tmp = Math.pow(a, 4.0);
} else if (a <= 2.15e+22) {
tmp = Math.pow(b, 4.0) + -1.0;
} else {
tmp = Math.pow(a, 4.0) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -1.7e+32: tmp = math.pow(a, 4.0) elif a <= 2.15e+22: tmp = math.pow(b, 4.0) + -1.0 else: tmp = math.pow(a, 4.0) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (a <= -1.7e+32) tmp = a ^ 4.0; elseif (a <= 2.15e+22) tmp = Float64((b ^ 4.0) + -1.0); else tmp = Float64((a ^ 4.0) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -1.7e+32) tmp = a ^ 4.0; elseif (a <= 2.15e+22) tmp = (b ^ 4.0) + -1.0; else tmp = (a ^ 4.0) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -1.7e+32], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 2.15e+22], N[(N[Power[b, 4.0], $MachinePrecision] + -1.0), $MachinePrecision], N[(N[Power[a, 4.0], $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{+22}:\\
\;\;\;\;{b}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4} + -1\\
\end{array}
\end{array}
if a < -1.69999999999999989e32Initial program 49.9%
associate--l+49.9%
sqr-pow49.9%
sqr-pow49.9%
fma-define49.9%
sqr-neg49.9%
Simplified49.9%
Taylor expanded in a around inf 98.2%
if -1.69999999999999989e32 < a < 2.1500000000000001e22Initial program 97.1%
associate--l+97.1%
sqr-pow97.1%
sqr-pow97.1%
fma-define97.1%
sqr-neg97.1%
Simplified97.1%
Taylor expanded in a around 0 87.2%
Taylor expanded in b around inf 93.3%
if 2.1500000000000001e22 < a Initial program 25.7%
associate--l+25.7%
sqr-pow25.7%
sqr-pow25.7%
fma-define25.7%
sqr-neg25.7%
Simplified32.6%
Taylor expanded in b around 0 21.0%
Taylor expanded in a around inf 95.1%
Final simplification94.7%
(FPCore (a b) :precision binary64 (if (or (<= a -0.42) (not (<= a 2.4))) (pow a 4.0) -1.0))
double code(double a, double b) {
double tmp;
if ((a <= -0.42) || !(a <= 2.4)) {
tmp = pow(a, 4.0);
} else {
tmp = -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 <= (-0.42d0)) .or. (.not. (a <= 2.4d0))) then
tmp = a ** 4.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((a <= -0.42) || !(a <= 2.4)) {
tmp = Math.pow(a, 4.0);
} else {
tmp = -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (a <= -0.42) or not (a <= 2.4): tmp = math.pow(a, 4.0) else: tmp = -1.0 return tmp
function code(a, b) tmp = 0.0 if ((a <= -0.42) || !(a <= 2.4)) tmp = a ^ 4.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((a <= -0.42) || ~((a <= 2.4))) tmp = a ^ 4.0; else tmp = -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[Or[LessEqual[a, -0.42], N[Not[LessEqual[a, 2.4]], $MachinePrecision]], N[Power[a, 4.0], $MachinePrecision], -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.42 \lor \neg \left(a \leq 2.4\right):\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if a < -0.419999999999999984 or 2.39999999999999991 < a Initial program 41.4%
associate--l+41.4%
sqr-pow41.4%
sqr-pow41.4%
fma-define41.4%
sqr-neg41.4%
Simplified44.6%
Taylor expanded in a around inf 88.2%
if -0.419999999999999984 < a < 2.39999999999999991Initial program 99.9%
associate--l+99.9%
sqr-pow99.9%
sqr-pow99.9%
fma-define99.9%
sqr-neg99.9%
Simplified99.9%
Taylor expanded in a around 0 92.5%
Taylor expanded in b around inf 96.3%
Taylor expanded in b around 0 49.2%
Final simplification68.3%
(FPCore (a b) :precision binary64 (if (<= b 7400000000000.0) (+ (pow a 4.0) -1.0) (pow b 4.0)))
double code(double a, double b) {
double tmp;
if (b <= 7400000000000.0) {
tmp = pow(a, 4.0) + -1.0;
} else {
tmp = pow(b, 4.0);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 7400000000000.0d0) then
tmp = (a ** 4.0d0) + (-1.0d0)
else
tmp = b ** 4.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 7400000000000.0) {
tmp = Math.pow(a, 4.0) + -1.0;
} else {
tmp = Math.pow(b, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 7400000000000.0: tmp = math.pow(a, 4.0) + -1.0 else: tmp = math.pow(b, 4.0) return tmp
function code(a, b) tmp = 0.0 if (b <= 7400000000000.0) tmp = Float64((a ^ 4.0) + -1.0); else tmp = b ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 7400000000000.0) tmp = (a ^ 4.0) + -1.0; else tmp = b ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 7400000000000.0], N[(N[Power[a, 4.0], $MachinePrecision] + -1.0), $MachinePrecision], N[Power[b, 4.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7400000000000:\\
\;\;\;\;{a}^{4} + -1\\
\mathbf{else}:\\
\;\;\;\;{b}^{4}\\
\end{array}
\end{array}
if b < 7.4e12Initial program 75.8%
associate--l+75.8%
sqr-pow75.8%
sqr-pow75.8%
fma-define75.8%
sqr-neg75.8%
Simplified76.3%
Taylor expanded in b around 0 62.0%
Taylor expanded in a around inf 76.5%
if 7.4e12 < b Initial program 58.4%
associate--l+58.4%
sqr-pow58.4%
sqr-pow58.4%
fma-define58.4%
sqr-neg58.4%
Simplified63.0%
Taylor expanded in b around inf 91.3%
Final simplification80.3%
(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 71.4%
associate--l+71.4%
sqr-pow71.4%
sqr-pow71.4%
fma-define71.4%
sqr-neg71.4%
Simplified72.9%
Taylor expanded in a around 0 59.8%
Taylor expanded in b around inf 70.9%
Taylor expanded in b around 0 25.5%
Final simplification25.5%
herbie shell --seed 2024050
(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))