
(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 12 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
(if (<=
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
INFINITY)
(+
(+ (pow b 4.0) (+ (* 2.0 (pow (* a b) 2.0)) (pow a 4.0)))
(+ (* 4.0 (fma (* a a) (- 1.0 a) (* b (* b (+ a 3.0))))) -1.0))
(+
(+
(pow b 4.0)
(* a (+ (* a (+ 4.0 (pow a 2.0))) (* (pow b 2.0) (+ 4.0 (* a 2.0))))))
-1.0)))
double code(double a, double b) {
double tmp;
if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= ((double) INFINITY)) {
tmp = (pow(b, 4.0) + ((2.0 * pow((a * b), 2.0)) + pow(a, 4.0))) + ((4.0 * fma((a * a), (1.0 - a), (b * (b * (a + 3.0))))) + -1.0);
} else {
tmp = (pow(b, 4.0) + (a * ((a * (4.0 + pow(a, 2.0))) + (pow(b, 2.0) * (4.0 + (a * 2.0)))))) + -1.0;
}
return tmp;
}
function code(a, b) tmp = 0.0 if (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))))) <= Inf) tmp = Float64(Float64((b ^ 4.0) + Float64(Float64(2.0 * (Float64(a * b) ^ 2.0)) + (a ^ 4.0))) + Float64(Float64(4.0 * fma(Float64(a * a), Float64(1.0 - a), Float64(b * Float64(b * Float64(a + 3.0))))) + -1.0)); else tmp = Float64(Float64((b ^ 4.0) + Float64(a * Float64(Float64(a * Float64(4.0 + (a ^ 2.0))) + Float64((b ^ 2.0) * Float64(4.0 + Float64(a * 2.0)))))) + -1.0); end return tmp end
code[a_, b_] := If[LessEqual[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], Infinity], N[(N[(N[Power[b, 4.0], $MachinePrecision] + N[(N[(2.0 * N[Power[N[(a * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[a, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(4.0 * N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision] + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[b, 4.0], $MachinePrecision] + N[(a * N[(N[(a * N[(4.0 + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * N[(4.0 + N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\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) \leq \infty:\\
\;\;\;\;\left({b}^{4} + \left(2 \cdot {\left(a \cdot b\right)}^{2} + {a}^{4}\right)\right) + \left(4 \cdot \mathsf{fma}\left(a \cdot a, 1 - a, b \cdot \left(b \cdot \left(a + 3\right)\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left({b}^{4} + a \cdot \left(a \cdot \left(4 + {a}^{2}\right) + {b}^{2} \cdot \left(4 + a \cdot 2\right)\right)\right) + -1\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < +inf.0Initial program 99.7%
associate--l+99.7%
fma-define99.7%
distribute-rgt-in99.7%
sqr-neg99.7%
distribute-rgt-in99.7%
Simplified99.7%
Taylor expanded in a around 0 94.2%
+-commutative94.2%
distribute-rgt-in90.5%
pow-sqr90.6%
metadata-eval90.6%
associate-*r*90.6%
*-commutative90.6%
fma-define90.6%
unpow290.6%
unpow290.6%
swap-sqr100.0%
unpow2100.0%
*-commutative100.0%
Simplified100.0%
fma-undefine100.0%
*-commutative100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 0.0%
Taylor expanded in a around 0 71.9%
Taylor expanded in a around inf 71.9%
Taylor expanded in a around 0 79.7%
Taylor expanded in b around 0 100.0%
Final simplification100.0%
(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 b 4.0)
(* a (+ (* a (+ 4.0 (pow a 2.0))) (* (pow b 2.0) (+ 4.0 (* a 2.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(b, 4.0) + (a * ((a * (4.0 + pow(a, 2.0))) + (pow(b, 2.0) * (4.0 + (a * 2.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(b, 4.0) + (a * ((a * (4.0 + Math.pow(a, 2.0))) + (Math.pow(b, 2.0) * (4.0 + (a * 2.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(b, 4.0) + (a * ((a * (4.0 + math.pow(a, 2.0))) + (math.pow(b, 2.0) * (4.0 + (a * 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(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(Float64((b ^ 4.0) + Float64(a * Float64(Float64(a * Float64(4.0 + (a ^ 2.0))) + Float64((b ^ 2.0) * Float64(4.0 + Float64(a * 2.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 = ((b ^ 4.0) + (a * ((a * (4.0 + (a ^ 2.0))) + ((b ^ 2.0) * (4.0 + (a * 2.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[(N[Power[b, 4.0], $MachinePrecision] + N[(a * N[(N[(a * N[(4.0 + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * N[(4.0 + N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;\left({b}^{4} + a \cdot \left(a \cdot \left(4 + {a}^{2}\right) + {b}^{2} \cdot \left(4 + a \cdot 2\right)\right)\right) + -1\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < +inf.0Initial program 99.7%
if +inf.0 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 0.0%
Taylor expanded in a around 0 71.9%
Taylor expanded in a around inf 71.9%
Taylor expanded in a around 0 79.7%
Taylor expanded in b around 0 100.0%
Final simplification99.8%
(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 2.0) (+ 4.0 (* a (- 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, 2.0) * (4.0 + (a * (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, 2.0) * (4.0 + (a * (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, 2.0) * (4.0 + (a * (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(Float64((a ^ 2.0) * Float64(4.0 + Float64(a * 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 ^ 2.0) * (4.0 + (a * (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[(N[Power[a, 2.0], $MachinePrecision] * N[(4.0 + N[(a * N[(a - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}^{2} \cdot \left(4 + a \cdot \left(a - 4\right)\right) + -1\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < +inf.0Initial program 99.7%
if +inf.0 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 0.0%
associate--l+0.0%
fma-define0.0%
distribute-rgt-in0.0%
sqr-neg0.0%
distribute-rgt-in0.0%
Simplified9.4%
Taylor expanded in b around 0 25.1%
Taylor expanded in a around 0 97.0%
Final simplification99.0%
(FPCore (a b)
:precision binary64
(if (<= a -2.6e+59)
(pow a 4.0)
(+
(+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* a a) (* (* b b) (+ a 3.0)))))
-1.0)))
double code(double a, double b) {
double tmp;
if (a <= -2.6e+59) {
tmp = pow(a, 4.0);
} else {
tmp = (pow(((a * a) + (b * b)), 2.0) + (4.0 * ((a * a) + ((b * b) * (a + 3.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 <= (-2.6d+59)) then
tmp = a ** 4.0d0
else
tmp = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * ((a * a) + ((b * b) * (a + 3.0d0))))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -2.6e+59) {
tmp = Math.pow(a, 4.0);
} else {
tmp = (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * ((a * a) + ((b * b) * (a + 3.0))))) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -2.6e+59: tmp = math.pow(a, 4.0) else: tmp = (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * ((a * a) + ((b * b) * (a + 3.0))))) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (a <= -2.6e+59) tmp = a ^ 4.0; else tmp = Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(a * a) + Float64(Float64(b * b) * Float64(a + 3.0))))) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -2.6e+59) tmp = a ^ 4.0; else tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * ((a * a) + ((b * b) * (a + 3.0))))) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -2.6e+59], N[Power[a, 4.0], $MachinePrecision], N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(a * a), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+59}:\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(a \cdot a + \left(b \cdot b\right) \cdot \left(a + 3\right)\right)\right) + -1\\
\end{array}
\end{array}
if a < -2.59999999999999999e59Initial program 63.5%
associate--l+63.5%
fma-define63.5%
distribute-rgt-in63.5%
sqr-neg63.5%
distribute-rgt-in63.5%
Simplified63.5%
Taylor expanded in a around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 100.0%
if -2.59999999999999999e59 < a Initial program 77.1%
Taylor expanded in a around 0 97.9%
Final simplification98.3%
(FPCore (a b) :precision binary64 (if (<= (* b b) 5e+140) (+ (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* a a) (* a (* b b))))) -1.0) (pow b 4.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 5e+140) {
tmp = (pow(((a * a) + (b * b)), 2.0) + (4.0 * ((a * a) + (a * (b * b))))) + -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 * b) <= 5d+140) then
tmp = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * ((a * a) + (a * (b * b))))) + (-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 * b) <= 5e+140) {
tmp = (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * ((a * a) + (a * (b * b))))) + -1.0;
} else {
tmp = Math.pow(b, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 5e+140: tmp = (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * ((a * a) + (a * (b * b))))) + -1.0 else: tmp = math.pow(b, 4.0) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 5e+140) tmp = Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(a * a) + Float64(a * Float64(b * b))))) + -1.0); else tmp = b ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 5e+140) tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * ((a * a) + (a * (b * b))))) + -1.0; else tmp = b ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 5e+140], N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(a * a), $MachinePrecision] + N[(a * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[b, 4.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(a \cdot a + a \cdot \left(b \cdot b\right)\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;{b}^{4}\\
\end{array}
\end{array}
if (*.f64 b b) < 5.00000000000000008e140Initial program 82.3%
Taylor expanded in a around 0 97.4%
Taylor expanded in a around inf 96.8%
if 5.00000000000000008e140 < (*.f64 b b) Initial program 59.0%
associate--l+59.0%
fma-define59.0%
distribute-rgt-in59.0%
sqr-neg59.0%
distribute-rgt-in59.0%
Simplified66.3%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around inf 100.0%
Final simplification97.8%
(FPCore (a b) :precision binary64 (if (or (<= a -75000000000.0) (not (<= a 152000000.0))) (* (pow a 4.0) (- 1.0 (/ 4.0 a))) (+ (+ (pow b 4.0) (* (* b b) 12.0)) -1.0)))
double code(double a, double b) {
double tmp;
if ((a <= -75000000000.0) || !(a <= 152000000.0)) {
tmp = pow(a, 4.0) * (1.0 - (4.0 / a));
} else {
tmp = (pow(b, 4.0) + ((b * b) * 12.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 <= (-75000000000.0d0)) .or. (.not. (a <= 152000000.0d0))) then
tmp = (a ** 4.0d0) * (1.0d0 - (4.0d0 / a))
else
tmp = ((b ** 4.0d0) + ((b * b) * 12.0d0)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((a <= -75000000000.0) || !(a <= 152000000.0)) {
tmp = Math.pow(a, 4.0) * (1.0 - (4.0 / a));
} else {
tmp = (Math.pow(b, 4.0) + ((b * b) * 12.0)) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (a <= -75000000000.0) or not (a <= 152000000.0): tmp = math.pow(a, 4.0) * (1.0 - (4.0 / a)) else: tmp = (math.pow(b, 4.0) + ((b * b) * 12.0)) + -1.0 return tmp
function code(a, b) tmp = 0.0 if ((a <= -75000000000.0) || !(a <= 152000000.0)) tmp = Float64((a ^ 4.0) * Float64(1.0 - Float64(4.0 / a))); else tmp = Float64(Float64((b ^ 4.0) + Float64(Float64(b * b) * 12.0)) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((a <= -75000000000.0) || ~((a <= 152000000.0))) tmp = (a ^ 4.0) * (1.0 - (4.0 / a)); else tmp = ((b ^ 4.0) + ((b * b) * 12.0)) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[Or[LessEqual[a, -75000000000.0], N[Not[LessEqual[a, 152000000.0]], $MachinePrecision]], N[(N[Power[a, 4.0], $MachinePrecision] * N[(1.0 - N[(4.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[b, 4.0], $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -75000000000 \lor \neg \left(a \leq 152000000\right):\\
\;\;\;\;{a}^{4} \cdot \left(1 - \frac{4}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\left({b}^{4} + \left(b \cdot b\right) \cdot 12\right) + -1\\
\end{array}
\end{array}
if a < -7.5e10 or 1.52e8 < a Initial program 45.9%
associate--l+45.9%
fma-define45.9%
distribute-rgt-in45.9%
sqr-neg45.9%
distribute-rgt-in45.9%
Simplified51.1%
Taylor expanded in a around inf 94.3%
associate-*r/94.3%
metadata-eval94.3%
Simplified94.3%
if -7.5e10 < a < 1.52e8Initial program 98.4%
associate--l+98.4%
fma-define98.4%
distribute-rgt-in98.4%
sqr-neg98.4%
distribute-rgt-in98.4%
Simplified98.4%
Taylor expanded in a around 0 99.0%
pow299.0%
Applied egg-rr99.0%
Final simplification96.9%
(FPCore (a b) :precision binary64 (if (or (<= a -75000000000.0) (not (<= a 15500000.0))) (pow a 4.0) (+ (* (* b b) 12.0) -1.0)))
double code(double a, double b) {
double tmp;
if ((a <= -75000000000.0) || !(a <= 15500000.0)) {
tmp = pow(a, 4.0);
} else {
tmp = ((b * b) * 12.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 <= (-75000000000.0d0)) .or. (.not. (a <= 15500000.0d0))) then
tmp = a ** 4.0d0
else
tmp = ((b * b) * 12.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((a <= -75000000000.0) || !(a <= 15500000.0)) {
tmp = Math.pow(a, 4.0);
} else {
tmp = ((b * b) * 12.0) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (a <= -75000000000.0) or not (a <= 15500000.0): tmp = math.pow(a, 4.0) else: tmp = ((b * b) * 12.0) + -1.0 return tmp
function code(a, b) tmp = 0.0 if ((a <= -75000000000.0) || !(a <= 15500000.0)) tmp = a ^ 4.0; else tmp = Float64(Float64(Float64(b * b) * 12.0) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((a <= -75000000000.0) || ~((a <= 15500000.0))) tmp = a ^ 4.0; else tmp = ((b * b) * 12.0) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[Or[LessEqual[a, -75000000000.0], N[Not[LessEqual[a, 15500000.0]], $MachinePrecision]], N[Power[a, 4.0], $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -75000000000 \lor \neg \left(a \leq 15500000\right):\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 12 + -1\\
\end{array}
\end{array}
if a < -7.5e10 or 1.55e7 < a Initial program 45.9%
associate--l+45.9%
fma-define45.9%
distribute-rgt-in45.9%
sqr-neg45.9%
distribute-rgt-in45.9%
Simplified51.1%
Taylor expanded in a around inf 94.3%
associate-*r/94.3%
metadata-eval94.3%
Simplified94.3%
Taylor expanded in a around inf 93.5%
if -7.5e10 < a < 1.55e7Initial program 98.4%
associate--l+98.4%
fma-define98.4%
distribute-rgt-in98.4%
sqr-neg98.4%
distribute-rgt-in98.4%
Simplified98.4%
Taylor expanded in a around 0 99.0%
Taylor expanded in b around 0 69.7%
pow299.0%
Applied egg-rr69.7%
Final simplification80.4%
(FPCore (a b) :precision binary64 (if (<= (* b b) 0.5) (+ (* (* a a) 4.0) -1.0) (pow b 4.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 0.5) {
tmp = ((a * 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 * b) <= 0.5d0) then
tmp = ((a * 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 * b) <= 0.5) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = Math.pow(b, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 0.5: tmp = ((a * a) * 4.0) + -1.0 else: tmp = math.pow(b, 4.0) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 0.5) tmp = Float64(Float64(Float64(a * 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 * b) <= 0.5) tmp = ((a * a) * 4.0) + -1.0; else tmp = b ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 0.5], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[b, 4.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 0.5:\\
\;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
\mathbf{else}:\\
\;\;\;\;{b}^{4}\\
\end{array}
\end{array}
if (*.f64 b b) < 0.5Initial program 83.1%
associate--l+83.1%
fma-define83.1%
distribute-rgt-in83.1%
sqr-neg83.1%
distribute-rgt-in83.1%
Simplified83.1%
Taylor expanded in b around 0 82.4%
Taylor expanded in a around 0 67.2%
*-commutative67.2%
Simplified67.2%
pow267.2%
Applied egg-rr67.2%
Taylor expanded in a around 0 80.6%
if 0.5 < (*.f64 b b) Initial program 66.1%
associate--l+66.1%
fma-define66.1%
distribute-rgt-in66.1%
sqr-neg66.1%
distribute-rgt-in66.1%
Simplified70.9%
Taylor expanded in a around 0 90.4%
Taylor expanded in b around inf 90.3%
Final simplification85.3%
(FPCore (a b) :precision binary64 (if (<= a -3e+86) (+ (* (* a a) (+ 4.0 (* a -4.0))) -1.0) (if (<= a 2.6e+138) (+ (* (* b b) 12.0) -1.0) (+ (* (* a a) 4.0) -1.0))))
double code(double a, double b) {
double tmp;
if (a <= -3e+86) {
tmp = ((a * a) * (4.0 + (a * -4.0))) + -1.0;
} else if (a <= 2.6e+138) {
tmp = ((b * b) * 12.0) + -1.0;
} else {
tmp = ((a * 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 <= (-3d+86)) then
tmp = ((a * a) * (4.0d0 + (a * (-4.0d0)))) + (-1.0d0)
else if (a <= 2.6d+138) then
tmp = ((b * b) * 12.0d0) + (-1.0d0)
else
tmp = ((a * a) * 4.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -3e+86) {
tmp = ((a * a) * (4.0 + (a * -4.0))) + -1.0;
} else if (a <= 2.6e+138) {
tmp = ((b * b) * 12.0) + -1.0;
} else {
tmp = ((a * a) * 4.0) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -3e+86: tmp = ((a * a) * (4.0 + (a * -4.0))) + -1.0 elif a <= 2.6e+138: tmp = ((b * b) * 12.0) + -1.0 else: tmp = ((a * a) * 4.0) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (a <= -3e+86) tmp = Float64(Float64(Float64(a * a) * Float64(4.0 + Float64(a * -4.0))) + -1.0); elseif (a <= 2.6e+138) tmp = Float64(Float64(Float64(b * b) * 12.0) + -1.0); else tmp = Float64(Float64(Float64(a * a) * 4.0) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -3e+86) tmp = ((a * a) * (4.0 + (a * -4.0))) + -1.0; elseif (a <= 2.6e+138) tmp = ((b * b) * 12.0) + -1.0; else tmp = ((a * a) * 4.0) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -3e+86], N[(N[(N[(a * a), $MachinePrecision] * N[(4.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[a, 2.6e+138], N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+86}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(4 + a \cdot -4\right) + -1\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+138}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 12 + -1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
\end{array}
\end{array}
if a < -2.99999999999999977e86Initial program 62.5%
associate--l+62.5%
fma-define62.5%
distribute-rgt-in62.5%
sqr-neg62.5%
distribute-rgt-in62.5%
Simplified62.5%
Taylor expanded in b around 0 100.0%
Taylor expanded in a around 0 90.8%
*-commutative90.8%
Simplified90.8%
pow290.8%
Applied egg-rr90.8%
if -2.99999999999999977e86 < a < 2.6000000000000001e138Initial program 95.1%
associate--l+95.1%
fma-define95.1%
distribute-rgt-in95.1%
sqr-neg95.1%
distribute-rgt-in95.1%
Simplified98.0%
Taylor expanded in a around 0 87.6%
Taylor expanded in b around 0 62.7%
pow287.6%
Applied egg-rr62.7%
if 2.6000000000000001e138 < a Initial program 0.0%
associate--l+0.0%
fma-define0.0%
distribute-rgt-in0.0%
sqr-neg0.0%
distribute-rgt-in0.0%
Simplified2.4%
Taylor expanded in b around 0 0.0%
Taylor expanded in a around 0 0.0%
*-commutative0.0%
Simplified0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in a around 0 95.6%
Final simplification72.4%
(FPCore (a b) :precision binary64 (if (<= (* b b) 8.6e+303) (+ (* (* a a) 4.0) -1.0) (+ (* (* b b) 12.0) -1.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 8.6e+303) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = ((b * b) * 12.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 ((b * b) <= 8.6d+303) then
tmp = ((a * a) * 4.0d0) + (-1.0d0)
else
tmp = ((b * b) * 12.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 8.6e+303) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = ((b * b) * 12.0) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 8.6e+303: tmp = ((a * a) * 4.0) + -1.0 else: tmp = ((b * b) * 12.0) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 8.6e+303) tmp = Float64(Float64(Float64(a * a) * 4.0) + -1.0); else tmp = Float64(Float64(Float64(b * b) * 12.0) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 8.6e+303) tmp = ((a * a) * 4.0) + -1.0; else tmp = ((b * b) * 12.0) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 8.6e+303], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 8.6 \cdot 10^{+303}:\\
\;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 12 + -1\\
\end{array}
\end{array}
if (*.f64 b b) < 8.59999999999999982e303Initial program 80.8%
associate--l+80.8%
fma-define80.8%
distribute-rgt-in80.8%
sqr-neg80.8%
distribute-rgt-in80.8%
Simplified81.3%
Taylor expanded in b around 0 60.0%
Taylor expanded in a around 0 47.8%
*-commutative47.8%
Simplified47.8%
pow247.8%
Applied egg-rr47.8%
Taylor expanded in a around 0 61.0%
if 8.59999999999999982e303 < (*.f64 b b) Initial program 55.0%
associate--l+55.0%
fma-define55.0%
distribute-rgt-in55.0%
sqr-neg55.0%
distribute-rgt-in55.0%
Simplified63.3%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around 0 98.6%
pow2100.0%
Applied egg-rr98.6%
Final simplification69.8%
(FPCore (a b) :precision binary64 (+ (* (* b b) 12.0) -1.0))
double code(double a, double b) {
return ((b * b) * 12.0) + -1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((b * b) * 12.0d0) + (-1.0d0)
end function
public static double code(double a, double b) {
return ((b * b) * 12.0) + -1.0;
}
def code(a, b): return ((b * b) * 12.0) + -1.0
function code(a, b) return Float64(Float64(Float64(b * b) * 12.0) + -1.0) end
function tmp = code(a, b) tmp = ((b * b) * 12.0) + -1.0; end
code[a_, b_] := N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot b\right) \cdot 12 + -1
\end{array}
Initial program 74.8%
associate--l+74.8%
fma-define74.8%
distribute-rgt-in74.8%
sqr-neg74.8%
distribute-rgt-in74.8%
Simplified77.1%
Taylor expanded in a around 0 70.4%
Taylor expanded in b around 0 50.8%
pow270.4%
Applied egg-rr50.8%
Final simplification50.8%
(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 74.8%
associate--l+74.8%
fma-define74.8%
distribute-rgt-in74.8%
sqr-neg74.8%
distribute-rgt-in74.8%
Simplified77.1%
Taylor expanded in a around 0 70.4%
Taylor expanded in b around 0 26.1%
herbie shell --seed 2024163
(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))