
(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 8 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
(hypot
(pow (hypot a b) 2.0)
(* 2.0 (hypot (hypot a (pow a 1.5)) (* b (sqrt (fma a -3.0 1.0))))))
2.0)
-1.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(hypot(pow(hypot(a, b), 2.0), (2.0 * hypot(hypot(a, pow(a, 1.5)), (b * sqrt(fma(a, -3.0, 1.0)))))), 2.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(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 = Float64((hypot((hypot(a, b) ^ 2.0), Float64(2.0 * hypot(hypot(a, (a ^ 1.5)), Float64(b * sqrt(fma(a, -3.0, 1.0)))))) ^ 2.0) + -1.0); end return 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[(N[Power[N[Sqrt[N[Power[N[Sqrt[a ^ 2 + b ^ 2], $MachinePrecision], 2.0], $MachinePrecision] ^ 2 + N[(2.0 * N[Sqrt[N[Sqrt[a ^ 2 + N[Power[a, 1.5], $MachinePrecision] ^ 2], $MachinePrecision] ^ 2 + N[(b * N[Sqrt[N[(a * -3.0 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.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(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}:\\
\;\;\;\;{\left(\mathsf{hypot}\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}, 2 \cdot \mathsf{hypot}\left(\mathsf{hypot}\left(a, {a}^{1.5}\right), b \cdot \sqrt{\mathsf{fma}\left(a, -3, 1\right)}\right)\right)\right)}^{2} + -1\\
\end{array}
\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}
(FPCore (a b) :precision binary64 (if (<= a -620.0) (* (pow a 2.0) (+ 4.0 (* a (+ a 4.0)))) (if (<= a 1.7e+55) (+ (+ (* (* b b) 4.0) (pow b 4.0)) -1.0) (pow a 4.0))))
double code(double a, double b) {
double tmp;
if (a <= -620.0) {
tmp = pow(a, 2.0) * (4.0 + (a * (a + 4.0)));
} else if (a <= 1.7e+55) {
tmp = (((b * b) * 4.0) + pow(b, 4.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 <= (-620.0d0)) then
tmp = (a ** 2.0d0) * (4.0d0 + (a * (a + 4.0d0)))
else if (a <= 1.7d+55) then
tmp = (((b * b) * 4.0d0) + (b ** 4.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 <= -620.0) {
tmp = Math.pow(a, 2.0) * (4.0 + (a * (a + 4.0)));
} else if (a <= 1.7e+55) {
tmp = (((b * b) * 4.0) + Math.pow(b, 4.0)) + -1.0;
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -620.0: tmp = math.pow(a, 2.0) * (4.0 + (a * (a + 4.0))) elif a <= 1.7e+55: tmp = (((b * b) * 4.0) + math.pow(b, 4.0)) + -1.0 else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) tmp = 0.0 if (a <= -620.0) tmp = Float64((a ^ 2.0) * Float64(4.0 + Float64(a * Float64(a + 4.0)))); elseif (a <= 1.7e+55) tmp = Float64(Float64(Float64(Float64(b * b) * 4.0) + (b ^ 4.0)) + -1.0); else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -620.0) tmp = (a ^ 2.0) * (4.0 + (a * (a + 4.0))); elseif (a <= 1.7e+55) tmp = (((b * b) * 4.0) + (b ^ 4.0)) + -1.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -620.0], N[(N[Power[a, 2.0], $MachinePrecision] * N[(4.0 + N[(a * N[(a + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e+55], N[(N[(N[(N[(b * b), $MachinePrecision] * 4.0), $MachinePrecision] + N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -620:\\
\;\;\;\;{a}^{2} \cdot \left(4 + a \cdot \left(a + 4\right)\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+55}:\\
\;\;\;\;\left(\left(b \cdot b\right) \cdot 4 + {b}^{4}\right) + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e-127) (+ (* 4.0 (pow a 2.0)) -1.0) (if (<= (* b b) 1e+69) (pow a 4.0) (pow b 4.0))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e-127) {
tmp = (4.0 * pow(a, 2.0)) + -1.0;
} else if ((b * b) <= 1e+69) {
tmp = pow(a, 4.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 * b) <= 1d-127) then
tmp = (4.0d0 * (a ** 2.0d0)) + (-1.0d0)
else if ((b * b) <= 1d+69) then
tmp = a ** 4.0d0
else
tmp = b ** 4.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1e-127) {
tmp = (4.0 * Math.pow(a, 2.0)) + -1.0;
} else if ((b * b) <= 1e+69) {
tmp = Math.pow(a, 4.0);
} else {
tmp = Math.pow(b, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1e-127: tmp = (4.0 * math.pow(a, 2.0)) + -1.0 elif (b * b) <= 1e+69: tmp = math.pow(a, 4.0) else: tmp = math.pow(b, 4.0) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e-127) tmp = Float64(Float64(4.0 * (a ^ 2.0)) + -1.0); elseif (Float64(b * b) <= 1e+69) tmp = a ^ 4.0; else tmp = b ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1e-127) tmp = (4.0 * (a ^ 2.0)) + -1.0; elseif ((b * b) <= 1e+69) tmp = a ^ 4.0; else tmp = b ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e-127], N[(N[(4.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(b * b), $MachinePrecision], 1e+69], N[Power[a, 4.0], $MachinePrecision], N[Power[b, 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10^{-127}:\\
\;\;\;\;4 \cdot {a}^{2} + -1\\
\mathbf{elif}\;b \cdot b \leq 10^{+69}:\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;{b}^{4}\\
\end{array}
\end{array}
(FPCore (a b) :precision binary64 (if (<= a -3200.0) (* (pow a 3.0) (+ a 4.0)) (if (<= a 1.7e+55) (+ (* (* b b) 4.0) -1.0) (pow a 4.0))))
double code(double a, double b) {
double tmp;
if (a <= -3200.0) {
tmp = pow(a, 3.0) * (a + 4.0);
} else if (a <= 1.7e+55) {
tmp = ((b * b) * 4.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 <= (-3200.0d0)) then
tmp = (a ** 3.0d0) * (a + 4.0d0)
else if (a <= 1.7d+55) then
tmp = ((b * b) * 4.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 <= -3200.0) {
tmp = Math.pow(a, 3.0) * (a + 4.0);
} else if (a <= 1.7e+55) {
tmp = ((b * b) * 4.0) + -1.0;
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -3200.0: tmp = math.pow(a, 3.0) * (a + 4.0) elif a <= 1.7e+55: tmp = ((b * b) * 4.0) + -1.0 else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) tmp = 0.0 if (a <= -3200.0) tmp = Float64((a ^ 3.0) * Float64(a + 4.0)); elseif (a <= 1.7e+55) tmp = Float64(Float64(Float64(b * b) * 4.0) + -1.0); else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -3200.0) tmp = (a ^ 3.0) * (a + 4.0); elseif (a <= 1.7e+55) tmp = ((b * b) * 4.0) + -1.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -3200.0], N[(N[Power[a, 3.0], $MachinePrecision] * N[(a + 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e+55], N[(N[(N[(b * b), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3200:\\
\;\;\;\;{a}^{3} \cdot \left(a + 4\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+55}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 4 + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
(FPCore (a b) :precision binary64 (if (or (<= a -7000.0) (not (<= a 1.7e+55))) (pow a 4.0) (+ (* (* b b) 4.0) -1.0)))
double code(double a, double b) {
double tmp;
if ((a <= -7000.0) || !(a <= 1.7e+55)) {
tmp = pow(a, 4.0);
} else {
tmp = ((b * b) * 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 <= (-7000.0d0)) .or. (.not. (a <= 1.7d+55))) then
tmp = a ** 4.0d0
else
tmp = ((b * b) * 4.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((a <= -7000.0) || !(a <= 1.7e+55)) {
tmp = Math.pow(a, 4.0);
} else {
tmp = ((b * b) * 4.0) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (a <= -7000.0) or not (a <= 1.7e+55): tmp = math.pow(a, 4.0) else: tmp = ((b * b) * 4.0) + -1.0 return tmp
function code(a, b) tmp = 0.0 if ((a <= -7000.0) || !(a <= 1.7e+55)) tmp = a ^ 4.0; else tmp = Float64(Float64(Float64(b * b) * 4.0) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((a <= -7000.0) || ~((a <= 1.7e+55))) tmp = a ^ 4.0; else tmp = ((b * b) * 4.0) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[Or[LessEqual[a, -7000.0], N[Not[LessEqual[a, 1.7e+55]], $MachinePrecision]], N[Power[a, 4.0], $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7000 \lor \neg \left(a \leq 1.7 \cdot 10^{+55}\right):\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 4 + -1\\
\end{array}
\end{array}
(FPCore (a b) :precision binary64 (+ (* (* b b) 4.0) -1.0))
double code(double a, double b) {
return ((b * b) * 4.0) + -1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((b * b) * 4.0d0) + (-1.0d0)
end function
public static double code(double a, double b) {
return ((b * b) * 4.0) + -1.0;
}
def code(a, b): return ((b * b) * 4.0) + -1.0
function code(a, b) return Float64(Float64(Float64(b * b) * 4.0) + -1.0) end
function tmp = code(a, b) tmp = ((b * b) * 4.0) + -1.0; end
code[a_, b_] := N[(N[(N[(b * b), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot b\right) \cdot 4 + -1
\end{array}
(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}
herbie shell --seed 2023364
(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))