
(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 13 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
(if (<= a -9.5e+71)
(pow a 4.0)
(+
(pow (fma a a (* b b)) 2.0)
(+
(* 4.0 (fma (* a a) (+ a 1.0) (pow (pow b 6.0) 0.3333333333333333)))
-1.0))))
double code(double a, double b) {
double tmp;
if (a <= -9.5e+71) {
tmp = pow(a, 4.0);
} else {
tmp = pow(fma(a, a, (b * b)), 2.0) + ((4.0 * fma((a * a), (a + 1.0), pow(pow(b, 6.0), 0.3333333333333333))) + -1.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= -9.5e+71) tmp = a ^ 4.0; else tmp = Float64((fma(a, a, Float64(b * b)) ^ 2.0) + Float64(Float64(4.0 * fma(Float64(a * a), Float64(a + 1.0), ((b ^ 6.0) ^ 0.3333333333333333))) + -1.0)); end return tmp end
code[a_, b_] := If[LessEqual[a, -9.5e+71], N[Power[a, 4.0], $MachinePrecision], N[(N[Power[N[(a * a + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(4.0 * N[(N[(a * a), $MachinePrecision] * N[(a + 1.0), $MachinePrecision] + N[Power[N[Power[b, 6.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+71}:\\
\;\;\;\;{a}^{4}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2} + \left(4 \cdot \mathsf{fma}\left(a \cdot a, a + 1, {\left({b}^{6}\right)}^{0.3333333333333333}\right) + -1\right)\\
\end{array}
\end{array}
if a < -9.50000000000000015e71Initial program 18.5%
associate--l+18.5%
fma-def18.5%
Simplified24.0%
Taylor expanded in a around inf 100.0%
if -9.50000000000000015e71 < a Initial program 88.5%
associate--l+88.5%
fma-def88.5%
Simplified88.5%
metadata-eval88.5%
cancel-sign-sub-inv88.5%
add-cbrt-cube82.2%
pow1/393.2%
pow393.2%
cancel-sign-sub-inv93.2%
metadata-eval93.2%
+-commutative93.2%
*-commutative93.2%
fma-udef93.2%
associate-*r*93.2%
Applied egg-rr93.2%
Taylor expanded in a around 0 98.6%
Final simplification98.9%
(FPCore (a b)
:precision binary64
(let* ((t_0
(+
(pow (+ (* b b) (* a a)) 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(((b * b) + (a * a)), 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(((b * b) + (a * a)), 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(((b * b) + (a * a)), 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(b * b) + Float64(a * a)) ^ 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 = (((b * b) + (a * a)) ^ 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[(b * b), $MachinePrecision] + N[(a * a), $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(b \cdot b + a \cdot a\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%
Simplified4.5%
Taylor expanded in a around inf 93.0%
Final simplification98.1%
(FPCore (a b)
:precision binary64
(if (<= a -1.7e+15)
(pow a 4.0)
(if (<= a 750000000000.0)
(+ (* b (* b (fma b b 4.0))) -1.0)
(+ (pow a 4.0) (+ -1.0 (* (+ a 1.0) (* 4.0 (* a a))))))))
double code(double a, double b) {
double tmp;
if (a <= -1.7e+15) {
tmp = pow(a, 4.0);
} else if (a <= 750000000000.0) {
tmp = (b * (b * fma(b, b, 4.0))) + -1.0;
} else {
tmp = pow(a, 4.0) + (-1.0 + ((a + 1.0) * (4.0 * (a * a))));
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= -1.7e+15) tmp = a ^ 4.0; elseif (a <= 750000000000.0) tmp = Float64(Float64(b * Float64(b * fma(b, b, 4.0))) + -1.0); else tmp = Float64((a ^ 4.0) + Float64(-1.0 + Float64(Float64(a + 1.0) * Float64(4.0 * Float64(a * a))))); end return tmp end
code[a_, b_] := If[LessEqual[a, -1.7e+15], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 750000000000.0], N[(N[(b * N[(b * N[(b * b + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[Power[a, 4.0], $MachinePrecision] + N[(-1.0 + N[(N[(a + 1.0), $MachinePrecision] * N[(4.0 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+15}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq 750000000000:\\
\;\;\;\;b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4} + \left(-1 + \left(a + 1\right) \cdot \left(4 \cdot \left(a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if a < -1.7e15Initial program 36.1%
associate--l+36.1%
fma-def36.1%
Simplified40.5%
Taylor expanded in a around inf 90.9%
if -1.7e15 < a < 7.5e11Initial program 98.2%
associate--l+98.2%
fma-def98.2%
Simplified98.2%
metadata-eval98.2%
cancel-sign-sub-inv98.2%
add-cbrt-cube96.1%
pow1/397.7%
pow397.7%
cancel-sign-sub-inv97.7%
metadata-eval97.7%
+-commutative97.7%
*-commutative97.7%
fma-udef97.7%
associate-*r*97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 97.7%
Taylor expanded in a around 0 99.8%
unpow299.8%
metadata-eval99.8%
pow-plus99.7%
unpow399.7%
associate-*r*99.7%
distribute-rgt-in99.7%
associate-*l*99.7%
fma-neg99.7%
+-commutative99.7%
fma-def99.7%
metadata-eval99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
if 7.5e11 < a Initial program 66.6%
associate--l+66.6%
fma-def66.6%
Simplified66.6%
Taylor expanded in b around 0 92.6%
associate--l+92.6%
associate-*r*92.6%
unpow292.6%
Simplified92.6%
Final simplification95.6%
(FPCore (a b) :precision binary64 (if (<= a -720000000000.0) (pow a 4.0) (if (<= a 550000000000.0) (+ (* b (* b (fma b b 4.0))) -1.0) (pow a 4.0))))
double code(double a, double b) {
double tmp;
if (a <= -720000000000.0) {
tmp = pow(a, 4.0);
} else if (a <= 550000000000.0) {
tmp = (b * (b * fma(b, b, 4.0))) + -1.0;
} else {
tmp = pow(a, 4.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= -720000000000.0) tmp = a ^ 4.0; elseif (a <= 550000000000.0) tmp = Float64(Float64(b * Float64(b * fma(b, b, 4.0))) + -1.0); else tmp = a ^ 4.0; end return tmp end
code[a_, b_] := If[LessEqual[a, -720000000000.0], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 550000000000.0], N[(N[(b * N[(b * N[(b * b + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -720000000000:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq 550000000000:\\
\;\;\;\;b \cdot \left(b \cdot \mathsf{fma}\left(b, b, 4\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -7.2e11 or 5.5e11 < a Initial program 50.7%
associate--l+50.7%
fma-def50.7%
Simplified53.0%
Taylor expanded in a around inf 91.5%
if -7.2e11 < a < 5.5e11Initial program 98.2%
associate--l+98.2%
fma-def98.2%
Simplified98.2%
metadata-eval98.2%
cancel-sign-sub-inv98.2%
add-cbrt-cube96.1%
pow1/397.7%
pow397.7%
cancel-sign-sub-inv97.7%
metadata-eval97.7%
+-commutative97.7%
*-commutative97.7%
fma-udef97.7%
associate-*r*97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 97.7%
Taylor expanded in a around 0 99.8%
unpow299.8%
metadata-eval99.8%
pow-plus99.7%
unpow399.7%
associate-*r*99.7%
distribute-rgt-in99.7%
associate-*l*99.7%
fma-neg99.7%
+-commutative99.7%
fma-def99.7%
metadata-eval99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Final simplification95.5%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* (* b b) (+ 4.0 (* b b)))))
(if (<= a -1.7e+16)
(pow a 4.0)
(if (<= a -1.4e-105)
t_0
(if (<= a -9.5e-165)
-1.0
(if (<= a -5.8e-241) t_0 (if (<= a 1.7e-8) -1.0 (pow a 4.0))))))))
double code(double a, double b) {
double t_0 = (b * b) * (4.0 + (b * b));
double tmp;
if (a <= -1.7e+16) {
tmp = pow(a, 4.0);
} else if (a <= -1.4e-105) {
tmp = t_0;
} else if (a <= -9.5e-165) {
tmp = -1.0;
} else if (a <= -5.8e-241) {
tmp = t_0;
} else if (a <= 1.7e-8) {
tmp = -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) :: t_0
real(8) :: tmp
t_0 = (b * b) * (4.0d0 + (b * b))
if (a <= (-1.7d+16)) then
tmp = a ** 4.0d0
else if (a <= (-1.4d-105)) then
tmp = t_0
else if (a <= (-9.5d-165)) then
tmp = -1.0d0
else if (a <= (-5.8d-241)) then
tmp = t_0
else if (a <= 1.7d-8) then
tmp = -1.0d0
else
tmp = a ** 4.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = (b * b) * (4.0 + (b * b));
double tmp;
if (a <= -1.7e+16) {
tmp = Math.pow(a, 4.0);
} else if (a <= -1.4e-105) {
tmp = t_0;
} else if (a <= -9.5e-165) {
tmp = -1.0;
} else if (a <= -5.8e-241) {
tmp = t_0;
} else if (a <= 1.7e-8) {
tmp = -1.0;
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): t_0 = (b * b) * (4.0 + (b * b)) tmp = 0 if a <= -1.7e+16: tmp = math.pow(a, 4.0) elif a <= -1.4e-105: tmp = t_0 elif a <= -9.5e-165: tmp = -1.0 elif a <= -5.8e-241: tmp = t_0 elif a <= 1.7e-8: tmp = -1.0 else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) t_0 = Float64(Float64(b * b) * Float64(4.0 + Float64(b * b))) tmp = 0.0 if (a <= -1.7e+16) tmp = a ^ 4.0; elseif (a <= -1.4e-105) tmp = t_0; elseif (a <= -9.5e-165) tmp = -1.0; elseif (a <= -5.8e-241) tmp = t_0; elseif (a <= 1.7e-8) tmp = -1.0; else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) t_0 = (b * b) * (4.0 + (b * b)); tmp = 0.0; if (a <= -1.7e+16) tmp = a ^ 4.0; elseif (a <= -1.4e-105) tmp = t_0; elseif (a <= -9.5e-165) tmp = -1.0; elseif (a <= -5.8e-241) tmp = t_0; elseif (a <= 1.7e-8) tmp = -1.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(N[(b * b), $MachinePrecision] * N[(4.0 + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e+16], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, -1.4e-105], t$95$0, If[LessEqual[a, -9.5e-165], -1.0, If[LessEqual[a, -5.8e-241], t$95$0, If[LessEqual[a, 1.7e-8], -1.0, N[Power[a, 4.0], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{+16}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-165}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq -5.8 \cdot 10^{-241}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-8}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -1.7e16 or 1.7e-8 < a Initial program 50.7%
associate--l+50.7%
fma-def50.7%
Simplified52.9%
Taylor expanded in a around inf 88.9%
if -1.7e16 < a < -1.4e-105 or -9.49999999999999973e-165 < a < -5.7999999999999998e-241Initial program 99.7%
associate--l+99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in b around inf 69.5%
*-commutative69.5%
fma-def69.5%
unpow269.5%
+-commutative69.5%
+-commutative69.5%
fma-def69.5%
unpow269.5%
distribute-lft-in69.5%
metadata-eval69.5%
associate-*r*69.5%
metadata-eval69.5%
Simplified69.5%
Taylor expanded in a around 0 69.5%
*-commutative69.5%
fma-def69.5%
unpow269.5%
Simplified69.5%
fma-udef69.5%
metadata-eval69.5%
pow-prod-up69.3%
pow269.3%
pow269.3%
distribute-lft-out69.3%
Applied egg-rr69.3%
if -1.4e-105 < a < -9.49999999999999973e-165 or -5.7999999999999998e-241 < a < 1.7e-8Initial program 99.9%
associate--l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around 0 68.2%
associate--l+68.2%
associate-*r*68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in a around 0 68.2%
Final simplification79.4%
(FPCore (a b)
:precision binary64
(if (<= a -9.8e+17)
(pow a 4.0)
(if (<= a -2.8e-103)
(* (* b b) (+ 4.0 (* b b)))
(if (<= a -1.22e-164)
-1.0
(if (<= a -1.9e-241)
(pow b 4.0)
(if (<= a 1.7e-8) -1.0 (pow a 4.0)))))))
double code(double a, double b) {
double tmp;
if (a <= -9.8e+17) {
tmp = pow(a, 4.0);
} else if (a <= -2.8e-103) {
tmp = (b * b) * (4.0 + (b * b));
} else if (a <= -1.22e-164) {
tmp = -1.0;
} else if (a <= -1.9e-241) {
tmp = pow(b, 4.0);
} else if (a <= 1.7e-8) {
tmp = -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 <= (-9.8d+17)) then
tmp = a ** 4.0d0
else if (a <= (-2.8d-103)) then
tmp = (b * b) * (4.0d0 + (b * b))
else if (a <= (-1.22d-164)) then
tmp = -1.0d0
else if (a <= (-1.9d-241)) then
tmp = b ** 4.0d0
else if (a <= 1.7d-8) then
tmp = -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 <= -9.8e+17) {
tmp = Math.pow(a, 4.0);
} else if (a <= -2.8e-103) {
tmp = (b * b) * (4.0 + (b * b));
} else if (a <= -1.22e-164) {
tmp = -1.0;
} else if (a <= -1.9e-241) {
tmp = Math.pow(b, 4.0);
} else if (a <= 1.7e-8) {
tmp = -1.0;
} else {
tmp = Math.pow(a, 4.0);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -9.8e+17: tmp = math.pow(a, 4.0) elif a <= -2.8e-103: tmp = (b * b) * (4.0 + (b * b)) elif a <= -1.22e-164: tmp = -1.0 elif a <= -1.9e-241: tmp = math.pow(b, 4.0) elif a <= 1.7e-8: tmp = -1.0 else: tmp = math.pow(a, 4.0) return tmp
function code(a, b) tmp = 0.0 if (a <= -9.8e+17) tmp = a ^ 4.0; elseif (a <= -2.8e-103) tmp = Float64(Float64(b * b) * Float64(4.0 + Float64(b * b))); elseif (a <= -1.22e-164) tmp = -1.0; elseif (a <= -1.9e-241) tmp = b ^ 4.0; elseif (a <= 1.7e-8) tmp = -1.0; else tmp = a ^ 4.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -9.8e+17) tmp = a ^ 4.0; elseif (a <= -2.8e-103) tmp = (b * b) * (4.0 + (b * b)); elseif (a <= -1.22e-164) tmp = -1.0; elseif (a <= -1.9e-241) tmp = b ^ 4.0; elseif (a <= 1.7e-8) tmp = -1.0; else tmp = a ^ 4.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -9.8e+17], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, -2.8e-103], N[(N[(b * b), $MachinePrecision] * N[(4.0 + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.22e-164], -1.0, If[LessEqual[a, -1.9e-241], N[Power[b, 4.0], $MachinePrecision], If[LessEqual[a, 1.7e-8], -1.0, N[Power[a, 4.0], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.8 \cdot 10^{+17}:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-103}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\mathbf{elif}\;a \leq -1.22 \cdot 10^{-164}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-241}:\\
\;\;\;\;{b}^{4}\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-8}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -9.8e17 or 1.7e-8 < a Initial program 50.7%
associate--l+50.7%
fma-def50.7%
Simplified52.9%
Taylor expanded in a around inf 88.9%
if -9.8e17 < a < -2.80000000000000023e-103Initial program 99.7%
associate--l+99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in b around inf 69.2%
*-commutative69.2%
fma-def69.2%
unpow269.2%
+-commutative69.2%
+-commutative69.2%
fma-def69.2%
unpow269.2%
distribute-lft-in69.2%
metadata-eval69.2%
associate-*r*69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in a around 0 69.2%
*-commutative69.2%
fma-def69.2%
unpow269.2%
Simplified69.2%
fma-udef69.2%
metadata-eval69.2%
pow-prod-up69.0%
pow269.0%
pow269.0%
distribute-lft-out69.0%
Applied egg-rr69.0%
if -2.80000000000000023e-103 < a < -1.2199999999999999e-164 or -1.8999999999999999e-241 < a < 1.7e-8Initial program 99.9%
associate--l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around 0 68.2%
associate--l+68.2%
associate-*r*68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in a around 0 68.2%
if -1.2199999999999999e-164 < a < -1.8999999999999999e-241Initial program 99.8%
associate--l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in b around inf 70.1%
Final simplification79.4%
(FPCore (a b) :precision binary64 (if (<= a -420000000000.0) (pow a 4.0) (if (<= a 980000000000.0) (fma b (* 4.0 b) -1.0) (pow a 4.0))))
double code(double a, double b) {
double tmp;
if (a <= -420000000000.0) {
tmp = pow(a, 4.0);
} else if (a <= 980000000000.0) {
tmp = fma(b, (4.0 * b), -1.0);
} else {
tmp = pow(a, 4.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= -420000000000.0) tmp = a ^ 4.0; elseif (a <= 980000000000.0) tmp = fma(b, Float64(4.0 * b), -1.0); else tmp = a ^ 4.0; end return tmp end
code[a_, b_] := If[LessEqual[a, -420000000000.0], N[Power[a, 4.0], $MachinePrecision], If[LessEqual[a, 980000000000.0], N[(b * N[(4.0 * b), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[a, 4.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -420000000000:\\
\;\;\;\;{a}^{4}\\
\mathbf{elif}\;a \leq 980000000000:\\
\;\;\;\;\mathsf{fma}\left(b, 4 \cdot b, -1\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{4}\\
\end{array}
\end{array}
if a < -4.2e11 or 9.8e11 < a Initial program 50.7%
associate--l+50.7%
fma-def50.7%
Simplified53.0%
Taylor expanded in a around inf 91.5%
if -4.2e11 < a < 9.8e11Initial program 98.2%
associate--l+98.2%
fma-def98.2%
Simplified98.2%
metadata-eval98.2%
cancel-sign-sub-inv98.2%
add-cbrt-cube96.1%
pow1/397.7%
pow397.7%
cancel-sign-sub-inv97.7%
metadata-eval97.7%
+-commutative97.7%
*-commutative97.7%
fma-udef97.7%
associate-*r*97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 97.7%
Taylor expanded in a around 0 99.8%
unpow299.8%
metadata-eval99.8%
pow-plus99.7%
unpow399.7%
associate-*r*99.7%
distribute-rgt-in99.7%
associate-*l*99.7%
fma-neg99.7%
+-commutative99.7%
fma-def99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 78.1%
Final simplification85.1%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+16) (fma a (* a 4.0) -1.0) (pow b 4.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+16) {
tmp = fma(a, (a * 4.0), -1.0);
} else {
tmp = pow(b, 4.0);
}
return tmp;
}
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+16) tmp = fma(a, Float64(a * 4.0), -1.0); else tmp = b ^ 4.0; end return tmp end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+16], N[(a * N[(a * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], N[Power[b, 4.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(a, a \cdot 4, -1\right)\\
\mathbf{else}:\\
\;\;\;\;{b}^{4}\\
\end{array}
\end{array}
if (*.f64 b b) < 1e16Initial program 81.7%
associate--l+81.7%
fma-def81.7%
Simplified81.7%
Taylor expanded in b around 0 80.3%
associate--l+80.3%
associate-*r*80.3%
unpow280.3%
Simplified80.3%
Taylor expanded in a around 0 73.9%
unpow273.9%
associate-*r*73.9%
*-commutative73.9%
fma-neg73.9%
*-commutative73.9%
metadata-eval73.9%
Simplified73.9%
if 1e16 < (*.f64 b b) Initial program 62.8%
associate--l+62.8%
fma-def62.8%
Simplified65.6%
Taylor expanded in b around inf 91.3%
Final simplification81.2%
(FPCore (a b) :precision binary64 (if (or (<= a -1.52e-12) (not (<= a 1.7e-8))) (* b (* b (* 2.0 (* a a)))) -1.0))
double code(double a, double b) {
double tmp;
if ((a <= -1.52e-12) || !(a <= 1.7e-8)) {
tmp = b * (b * (2.0 * (a * a)));
} 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 <= (-1.52d-12)) .or. (.not. (a <= 1.7d-8))) then
tmp = b * (b * (2.0d0 * (a * a)))
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((a <= -1.52e-12) || !(a <= 1.7e-8)) {
tmp = b * (b * (2.0 * (a * a)));
} else {
tmp = -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (a <= -1.52e-12) or not (a <= 1.7e-8): tmp = b * (b * (2.0 * (a * a))) else: tmp = -1.0 return tmp
function code(a, b) tmp = 0.0 if ((a <= -1.52e-12) || !(a <= 1.7e-8)) tmp = Float64(b * Float64(b * Float64(2.0 * Float64(a * a)))); else tmp = -1.0; end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((a <= -1.52e-12) || ~((a <= 1.7e-8))) tmp = b * (b * (2.0 * (a * a))); else tmp = -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[Or[LessEqual[a, -1.52e-12], N[Not[LessEqual[a, 1.7e-8]], $MachinePrecision]], N[(b * N[(b * N[(2.0 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.52 \cdot 10^{-12} \lor \neg \left(a \leq 1.7 \cdot 10^{-8}\right):\\
\;\;\;\;b \cdot \left(b \cdot \left(2 \cdot \left(a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if a < -1.52e-12 or 1.7e-8 < a Initial program 53.1%
associate--l+53.1%
fma-def53.1%
Simplified55.2%
Taylor expanded in b around inf 57.1%
*-commutative57.1%
fma-def57.1%
unpow257.1%
+-commutative57.1%
+-commutative57.1%
fma-def57.1%
unpow257.1%
distribute-lft-in57.1%
metadata-eval57.1%
associate-*r*57.1%
metadata-eval57.1%
Simplified57.1%
Taylor expanded in a around inf 53.9%
associate-*r*53.9%
*-commutative53.9%
associate-*l*53.9%
unpow253.9%
unpow253.9%
Simplified53.9%
Taylor expanded in a around 0 53.9%
*-commutative53.9%
unpow253.9%
*-commutative53.9%
unpow253.9%
associate-*r*47.5%
associate-*r*47.7%
associate-*r*47.7%
associate-*l*52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in b around 0 65.8%
associate-*r*65.8%
unpow265.8%
Simplified65.8%
if -1.52e-12 < a < 1.7e-8Initial program 99.9%
associate--l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around 0 60.3%
associate--l+60.3%
associate-*r*60.3%
unpow260.3%
Simplified60.3%
Taylor expanded in a around 0 60.3%
Final simplification63.4%
(FPCore (a b) :precision binary64 (if (<= b 0.48) -1.0 (if (<= b 1.75e+148) (* -12.0 (* a (* b b))) (* b (* 4.0 b)))))
double code(double a, double b) {
double tmp;
if (b <= 0.48) {
tmp = -1.0;
} else if (b <= 1.75e+148) {
tmp = -12.0 * (a * (b * b));
} else {
tmp = b * (4.0 * b);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 0.48d0) then
tmp = -1.0d0
else if (b <= 1.75d+148) then
tmp = (-12.0d0) * (a * (b * b))
else
tmp = b * (4.0d0 * b)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 0.48) {
tmp = -1.0;
} else if (b <= 1.75e+148) {
tmp = -12.0 * (a * (b * b));
} else {
tmp = b * (4.0 * b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 0.48: tmp = -1.0 elif b <= 1.75e+148: tmp = -12.0 * (a * (b * b)) else: tmp = b * (4.0 * b) return tmp
function code(a, b) tmp = 0.0 if (b <= 0.48) tmp = -1.0; elseif (b <= 1.75e+148) tmp = Float64(-12.0 * Float64(a * Float64(b * b))); else tmp = Float64(b * Float64(4.0 * b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 0.48) tmp = -1.0; elseif (b <= 1.75e+148) tmp = -12.0 * (a * (b * b)); else tmp = b * (4.0 * b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 0.48], -1.0, If[LessEqual[b, 1.75e+148], N[(-12.0 * N[(a * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(4.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.48:\\
\;\;\;\;-1\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{+148}:\\
\;\;\;\;-12 \cdot \left(a \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(4 \cdot b\right)\\
\end{array}
\end{array}
if b < 0.47999999999999998Initial program 77.6%
associate--l+77.6%
fma-def77.6%
Simplified77.6%
Taylor expanded in b around 0 65.9%
associate--l+65.9%
associate-*r*65.9%
unpow265.9%
Simplified65.9%
Taylor expanded in a around 0 35.3%
if 0.47999999999999998 < b < 1.7499999999999999e148Initial program 65.1%
associate--l+65.1%
fma-def65.1%
Simplified65.1%
Taylor expanded in b around inf 87.4%
*-commutative87.4%
fma-def87.4%
unpow287.4%
+-commutative87.4%
+-commutative87.4%
fma-def87.4%
unpow287.4%
distribute-lft-in87.4%
metadata-eval87.4%
associate-*r*87.4%
metadata-eval87.4%
Simplified87.4%
Taylor expanded in a around inf 30.3%
associate-*r*30.3%
*-commutative30.3%
associate-*r*30.3%
distribute-rgt-out44.1%
*-commutative44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
associate-*r*44.1%
distribute-rgt-out44.1%
*-commutative44.1%
Simplified44.1%
Taylor expanded in a around 0 12.8%
unpow212.8%
*-commutative12.8%
associate-*r*12.8%
associate-*r*12.8%
Simplified12.8%
Taylor expanded in b around 0 12.8%
*-commutative12.8%
unpow212.8%
Simplified12.8%
if 1.7499999999999999e148 < b Initial program 56.7%
associate--l+56.7%
fma-def56.7%
Simplified66.7%
Taylor expanded in b around inf 100.0%
*-commutative100.0%
fma-def100.0%
unpow2100.0%
+-commutative100.0%
+-commutative100.0%
fma-def100.0%
unpow2100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
*-commutative100.0%
fma-def100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in b around 0 91.1%
unpow291.1%
*-commutative91.1%
associate-*l*91.1%
Simplified91.1%
Final simplification39.3%
(FPCore (a b) :precision binary64 (if (<= b 0.48) -1.0 (* (* b b) (+ 4.0 (* b b)))))
double code(double a, double b) {
double tmp;
if (b <= 0.48) {
tmp = -1.0;
} else {
tmp = (b * b) * (4.0 + (b * b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 0.48d0) then
tmp = -1.0d0
else
tmp = (b * b) * (4.0d0 + (b * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 0.48) {
tmp = -1.0;
} else {
tmp = (b * b) * (4.0 + (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 0.48: tmp = -1.0 else: tmp = (b * b) * (4.0 + (b * b)) return tmp
function code(a, b) tmp = 0.0 if (b <= 0.48) tmp = -1.0; else tmp = Float64(Float64(b * b) * Float64(4.0 + Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 0.48) tmp = -1.0; else tmp = (b * b) * (4.0 + (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 0.48], -1.0, N[(N[(b * b), $MachinePrecision] * N[(4.0 + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.48:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(4 + b \cdot b\right)\\
\end{array}
\end{array}
if b < 0.47999999999999998Initial program 77.6%
associate--l+77.6%
fma-def77.6%
Simplified77.6%
Taylor expanded in b around 0 65.9%
associate--l+65.9%
associate-*r*65.9%
unpow265.9%
Simplified65.9%
Taylor expanded in a around 0 35.3%
if 0.47999999999999998 < b Initial program 60.8%
associate--l+60.8%
fma-def60.8%
Simplified65.9%
Taylor expanded in b around inf 93.8%
*-commutative93.8%
fma-def93.8%
unpow293.8%
+-commutative93.8%
+-commutative93.8%
fma-def93.8%
unpow293.8%
distribute-lft-in93.8%
metadata-eval93.8%
associate-*r*93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in a around 0 83.8%
*-commutative83.8%
fma-def83.8%
unpow283.8%
Simplified83.8%
fma-udef83.8%
metadata-eval83.8%
pow-prod-up83.7%
pow283.7%
pow283.7%
distribute-lft-out83.7%
Applied egg-rr83.7%
Final simplification46.4%
(FPCore (a b) :precision binary64 (if (<= b 0.48) -1.0 (* b (* 4.0 b))))
double code(double a, double b) {
double tmp;
if (b <= 0.48) {
tmp = -1.0;
} else {
tmp = b * (4.0 * b);
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 0.48d0) then
tmp = -1.0d0
else
tmp = b * (4.0d0 * b)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 0.48) {
tmp = -1.0;
} else {
tmp = b * (4.0 * b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 0.48: tmp = -1.0 else: tmp = b * (4.0 * b) return tmp
function code(a, b) tmp = 0.0 if (b <= 0.48) tmp = -1.0; else tmp = Float64(b * Float64(4.0 * b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 0.48) tmp = -1.0; else tmp = b * (4.0 * b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 0.48], -1.0, N[(b * N[(4.0 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.48:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(4 \cdot b\right)\\
\end{array}
\end{array}
if b < 0.47999999999999998Initial program 77.6%
associate--l+77.6%
fma-def77.6%
Simplified77.6%
Taylor expanded in b around 0 65.9%
associate--l+65.9%
associate-*r*65.9%
unpow265.9%
Simplified65.9%
Taylor expanded in a around 0 35.3%
if 0.47999999999999998 < b Initial program 60.8%
associate--l+60.8%
fma-def60.8%
Simplified65.9%
Taylor expanded in b around inf 93.8%
*-commutative93.8%
fma-def93.8%
unpow293.8%
+-commutative93.8%
+-commutative93.8%
fma-def93.8%
unpow293.8%
distribute-lft-in93.8%
metadata-eval93.8%
associate-*r*93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in a around 0 83.8%
*-commutative83.8%
fma-def83.8%
unpow283.8%
Simplified83.8%
Taylor expanded in b around 0 49.2%
unpow249.2%
*-commutative49.2%
associate-*l*49.2%
Simplified49.2%
Final simplification38.5%
(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 73.7%
associate--l+73.7%
fma-def73.7%
Simplified74.9%
Taylor expanded in b around 0 57.2%
associate--l+57.2%
associate-*r*57.2%
unpow257.2%
Simplified57.2%
Taylor expanded in a around 0 27.3%
Final simplification27.3%
herbie shell --seed 2023252
(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))