
(FPCore (x y) :precision binary64 (- (pow x 4.0) (pow y 4.0)))
double code(double x, double y) {
return pow(x, 4.0) - pow(y, 4.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x ** 4.0d0) - (y ** 4.0d0)
end function
public static double code(double x, double y) {
return Math.pow(x, 4.0) - Math.pow(y, 4.0);
}
def code(x, y): return math.pow(x, 4.0) - math.pow(y, 4.0)
function code(x, y) return Float64((x ^ 4.0) - (y ^ 4.0)) end
function tmp = code(x, y) tmp = (x ^ 4.0) - (y ^ 4.0); end
code[x_, y_] := N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{x}^{4} - {y}^{4}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- (pow x 4.0) (pow y 4.0)))
double code(double x, double y) {
return pow(x, 4.0) - pow(y, 4.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x ** 4.0d0) - (y ** 4.0d0)
end function
public static double code(double x, double y) {
return Math.pow(x, 4.0) - Math.pow(y, 4.0);
}
def code(x, y): return math.pow(x, 4.0) - math.pow(y, 4.0)
function code(x, y) return Float64((x ^ 4.0) - (y ^ 4.0)) end
function tmp = code(x, y) tmp = (x ^ 4.0) - (y ^ 4.0); end
code[x_, y_] := N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{x}^{4} - {y}^{4}
\end{array}
(FPCore (x y) :precision binary64 (if (<= y 1.35e+154) (* (- (* x x) (* y y)) (+ (* x x) (* y y))) (* (* y y) (/ 1.0 (/ -1.0 (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= 1.35e+154) {
tmp = ((x * x) - (y * y)) * ((x * x) + (y * y));
} else {
tmp = (y * y) * (1.0 / (-1.0 / (y * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.35d+154) then
tmp = ((x * x) - (y * y)) * ((x * x) + (y * y))
else
tmp = (y * y) * (1.0d0 / ((-1.0d0) / (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.35e+154) {
tmp = ((x * x) - (y * y)) * ((x * x) + (y * y));
} else {
tmp = (y * y) * (1.0 / (-1.0 / (y * y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.35e+154: tmp = ((x * x) - (y * y)) * ((x * x) + (y * y)) else: tmp = (y * y) * (1.0 / (-1.0 / (y * y))) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.35e+154) tmp = Float64(Float64(Float64(x * x) - Float64(y * y)) * Float64(Float64(x * x) + Float64(y * y))); else tmp = Float64(Float64(y * y) * Float64(1.0 / Float64(-1.0 / Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.35e+154) tmp = ((x * x) - (y * y)) * ((x * x) + (y * y)); else tmp = (y * y) * (1.0 / (-1.0 / (y * y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.35e+154], N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(1.0 / N[(-1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(x \cdot x - y \cdot y\right) \cdot \left(x \cdot x + y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \frac{1}{\frac{-1}{y \cdot y}}\\
\end{array}
\end{array}
if y < 1.35000000000000003e154Initial program 87.6%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr96.6%
if 1.35000000000000003e154 < y Initial program 53.3%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr66.7%
flip--N/A
associate-*r*N/A
associate-*r*N/A
remove-double-divN/A
+-commutativeN/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
Applied egg-rr0.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Taylor expanded in y around inf
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Final simplification95.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x (* x x)))) (t_1 (* (* x x) (- (* x x) (* y y)))))
(if (<= x -1.8e+178)
t_0
(if (<= x -1.05e-72)
t_1
(if (<= x 26.5)
(* y (* y (- 0.0 (* y y))))
(if (<= x 3.8e+145) t_1 t_0))))))
double code(double x, double y) {
double t_0 = x * (x * (x * x));
double t_1 = (x * x) * ((x * x) - (y * y));
double tmp;
if (x <= -1.8e+178) {
tmp = t_0;
} else if (x <= -1.05e-72) {
tmp = t_1;
} else if (x <= 26.5) {
tmp = y * (y * (0.0 - (y * y)));
} else if (x <= 3.8e+145) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * (x * (x * x))
t_1 = (x * x) * ((x * x) - (y * y))
if (x <= (-1.8d+178)) then
tmp = t_0
else if (x <= (-1.05d-72)) then
tmp = t_1
else if (x <= 26.5d0) then
tmp = y * (y * (0.0d0 - (y * y)))
else if (x <= 3.8d+145) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (x * (x * x));
double t_1 = (x * x) * ((x * x) - (y * y));
double tmp;
if (x <= -1.8e+178) {
tmp = t_0;
} else if (x <= -1.05e-72) {
tmp = t_1;
} else if (x <= 26.5) {
tmp = y * (y * (0.0 - (y * y)));
} else if (x <= 3.8e+145) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (x * (x * x)) t_1 = (x * x) * ((x * x) - (y * y)) tmp = 0 if x <= -1.8e+178: tmp = t_0 elif x <= -1.05e-72: tmp = t_1 elif x <= 26.5: tmp = y * (y * (0.0 - (y * y))) elif x <= 3.8e+145: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(x * Float64(x * x))) t_1 = Float64(Float64(x * x) * Float64(Float64(x * x) - Float64(y * y))) tmp = 0.0 if (x <= -1.8e+178) tmp = t_0; elseif (x <= -1.05e-72) tmp = t_1; elseif (x <= 26.5) tmp = Float64(y * Float64(y * Float64(0.0 - Float64(y * y)))); elseif (x <= 3.8e+145) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (x * (x * x)); t_1 = (x * x) * ((x * x) - (y * y)); tmp = 0.0; if (x <= -1.8e+178) tmp = t_0; elseif (x <= -1.05e-72) tmp = t_1; elseif (x <= 26.5) tmp = y * (y * (0.0 - (y * y))); elseif (x <= 3.8e+145) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e+178], t$95$0, If[LessEqual[x, -1.05e-72], t$95$1, If[LessEqual[x, 26.5], N[(y * N[(y * N[(0.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+145], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
t_1 := \left(x \cdot x\right) \cdot \left(x \cdot x - y \cdot y\right)\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 26.5:\\
\;\;\;\;y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.7999999999999999e178 or 3.80000000000000012e145 < x Initial program 61.2%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr74.6%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
+-lft-identityN/A
unpow2N/A
mul0-lftN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-+r+N/A
+-commutativeN/A
associate-*l*N/A
+-commutativeN/A
associate-+r+N/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
Simplified86.6%
if -1.7999999999999999e178 < x < -1.05e-72 or 26.5 < x < 3.80000000000000012e145Initial program 81.4%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr99.6%
Taylor expanded in y around 0
unpow2N/A
*-lowering-*.f6492.5%
Simplified92.5%
if -1.05e-72 < x < 26.5Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
Taylor expanded in x around 0
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
Final simplification91.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- (* x x) (* y y)) (/ 1.0 (* y y)))))
(if (<= y -950000000.0)
t_0
(if (<= y 9.5e-36)
(* x (* x (* x x)))
(if (<= y 1.35e+154) t_0 (* (* y y) (/ 1.0 (/ -1.0 (* y y)))))))))
double code(double x, double y) {
double t_0 = ((x * x) - (y * y)) / (1.0 / (y * y));
double tmp;
if (y <= -950000000.0) {
tmp = t_0;
} else if (y <= 9.5e-36) {
tmp = x * (x * (x * x));
} else if (y <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (y * y) * (1.0 / (-1.0 / (y * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = ((x * x) - (y * y)) / (1.0d0 / (y * y))
if (y <= (-950000000.0d0)) then
tmp = t_0
else if (y <= 9.5d-36) then
tmp = x * (x * (x * x))
else if (y <= 1.35d+154) then
tmp = t_0
else
tmp = (y * y) * (1.0d0 / ((-1.0d0) / (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = ((x * x) - (y * y)) / (1.0 / (y * y));
double tmp;
if (y <= -950000000.0) {
tmp = t_0;
} else if (y <= 9.5e-36) {
tmp = x * (x * (x * x));
} else if (y <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (y * y) * (1.0 / (-1.0 / (y * y)));
}
return tmp;
}
def code(x, y): t_0 = ((x * x) - (y * y)) / (1.0 / (y * y)) tmp = 0 if y <= -950000000.0: tmp = t_0 elif y <= 9.5e-36: tmp = x * (x * (x * x)) elif y <= 1.35e+154: tmp = t_0 else: tmp = (y * y) * (1.0 / (-1.0 / (y * y))) return tmp
function code(x, y) t_0 = Float64(Float64(Float64(x * x) - Float64(y * y)) / Float64(1.0 / Float64(y * y))) tmp = 0.0 if (y <= -950000000.0) tmp = t_0; elseif (y <= 9.5e-36) tmp = Float64(x * Float64(x * Float64(x * x))); elseif (y <= 1.35e+154) tmp = t_0; else tmp = Float64(Float64(y * y) * Float64(1.0 / Float64(-1.0 / Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = ((x * x) - (y * y)) / (1.0 / (y * y)); tmp = 0.0; if (y <= -950000000.0) tmp = t_0; elseif (y <= 9.5e-36) tmp = x * (x * (x * x)); elseif (y <= 1.35e+154) tmp = t_0; else tmp = (y * y) * (1.0 / (-1.0 / (y * y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -950000000.0], t$95$0, If[LessEqual[y, 9.5e-36], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], t$95$0, N[(N[(y * y), $MachinePrecision] * N[(1.0 / N[(-1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot x - y \cdot y}{\frac{1}{y \cdot y}}\\
\mathbf{if}\;y \leq -950000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \frac{1}{\frac{-1}{y \cdot y}}\\
\end{array}
\end{array}
if y < -9.5e8 or 9.5000000000000003e-36 < y < 1.35000000000000003e154Initial program 71.4%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr92.6%
flip--N/A
associate-*r*N/A
associate-*r*N/A
remove-double-divN/A
+-commutativeN/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
Applied egg-rr54.8%
associate-/r*N/A
+-commutativeN/A
flip-+N/A
associate-*r*N/A
associate-*r*N/A
frac-timesN/A
Applied egg-rr92.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
if -9.5e8 < y < 9.5000000000000003e-36Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
+-lft-identityN/A
unpow2N/A
mul0-lftN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-+r+N/A
+-commutativeN/A
associate-*l*N/A
+-commutativeN/A
associate-+r+N/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
Simplified94.1%
if 1.35000000000000003e154 < y Initial program 53.3%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr66.7%
flip--N/A
associate-*r*N/A
associate-*r*N/A
remove-double-divN/A
+-commutativeN/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
Applied egg-rr0.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Taylor expanded in y around inf
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Final simplification90.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* y y) (- (* x x) (* y y)))))
(if (<= y -850000000.0)
t_0
(if (<= y 1.02e-35)
(* x (* x (* x x)))
(if (<= y 1.35e+154) t_0 (* (* y y) (/ 1.0 (/ -1.0 (* y y)))))))))
double code(double x, double y) {
double t_0 = (y * y) * ((x * x) - (y * y));
double tmp;
if (y <= -850000000.0) {
tmp = t_0;
} else if (y <= 1.02e-35) {
tmp = x * (x * (x * x));
} else if (y <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (y * y) * (1.0 / (-1.0 / (y * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y * y) * ((x * x) - (y * y))
if (y <= (-850000000.0d0)) then
tmp = t_0
else if (y <= 1.02d-35) then
tmp = x * (x * (x * x))
else if (y <= 1.35d+154) then
tmp = t_0
else
tmp = (y * y) * (1.0d0 / ((-1.0d0) / (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * y) * ((x * x) - (y * y));
double tmp;
if (y <= -850000000.0) {
tmp = t_0;
} else if (y <= 1.02e-35) {
tmp = x * (x * (x * x));
} else if (y <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (y * y) * (1.0 / (-1.0 / (y * y)));
}
return tmp;
}
def code(x, y): t_0 = (y * y) * ((x * x) - (y * y)) tmp = 0 if y <= -850000000.0: tmp = t_0 elif y <= 1.02e-35: tmp = x * (x * (x * x)) elif y <= 1.35e+154: tmp = t_0 else: tmp = (y * y) * (1.0 / (-1.0 / (y * y))) return tmp
function code(x, y) t_0 = Float64(Float64(y * y) * Float64(Float64(x * x) - Float64(y * y))) tmp = 0.0 if (y <= -850000000.0) tmp = t_0; elseif (y <= 1.02e-35) tmp = Float64(x * Float64(x * Float64(x * x))); elseif (y <= 1.35e+154) tmp = t_0; else tmp = Float64(Float64(y * y) * Float64(1.0 / Float64(-1.0 / Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * y) * ((x * x) - (y * y)); tmp = 0.0; if (y <= -850000000.0) tmp = t_0; elseif (y <= 1.02e-35) tmp = x * (x * (x * x)); elseif (y <= 1.35e+154) tmp = t_0; else tmp = (y * y) * (1.0 / (-1.0 / (y * y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -850000000.0], t$95$0, If[LessEqual[y, 1.02e-35], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], t$95$0, N[(N[(y * y), $MachinePrecision] * N[(1.0 / N[(-1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\
\mathbf{if}\;y \leq -850000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-35}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \frac{1}{\frac{-1}{y \cdot y}}\\
\end{array}
\end{array}
if y < -8.5e8 or 1.01999999999999995e-35 < y < 1.35000000000000003e154Initial program 71.4%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr92.6%
Taylor expanded in y around inf
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
if -8.5e8 < y < 1.01999999999999995e-35Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
+-lft-identityN/A
unpow2N/A
mul0-lftN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-+r+N/A
+-commutativeN/A
associate-*l*N/A
+-commutativeN/A
associate-+r+N/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
Simplified94.1%
if 1.35000000000000003e154 < y Initial program 53.3%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr66.7%
flip--N/A
associate-*r*N/A
associate-*r*N/A
remove-double-divN/A
+-commutativeN/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
Applied egg-rr0.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Taylor expanded in y around inf
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Final simplification90.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* y y) (- (* x x) (* y y)))))
(if (<= y -1550000000.0)
t_0
(if (<= y 4.1e-39)
(* x (* x (* x x)))
(if (<= y 1.3e+154) t_0 (* y (* y (- 0.0 (* y y)))))))))
double code(double x, double y) {
double t_0 = (y * y) * ((x * x) - (y * y));
double tmp;
if (y <= -1550000000.0) {
tmp = t_0;
} else if (y <= 4.1e-39) {
tmp = x * (x * (x * x));
} else if (y <= 1.3e+154) {
tmp = t_0;
} else {
tmp = y * (y * (0.0 - (y * y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y * y) * ((x * x) - (y * y))
if (y <= (-1550000000.0d0)) then
tmp = t_0
else if (y <= 4.1d-39) then
tmp = x * (x * (x * x))
else if (y <= 1.3d+154) then
tmp = t_0
else
tmp = y * (y * (0.0d0 - (y * y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * y) * ((x * x) - (y * y));
double tmp;
if (y <= -1550000000.0) {
tmp = t_0;
} else if (y <= 4.1e-39) {
tmp = x * (x * (x * x));
} else if (y <= 1.3e+154) {
tmp = t_0;
} else {
tmp = y * (y * (0.0 - (y * y)));
}
return tmp;
}
def code(x, y): t_0 = (y * y) * ((x * x) - (y * y)) tmp = 0 if y <= -1550000000.0: tmp = t_0 elif y <= 4.1e-39: tmp = x * (x * (x * x)) elif y <= 1.3e+154: tmp = t_0 else: tmp = y * (y * (0.0 - (y * y))) return tmp
function code(x, y) t_0 = Float64(Float64(y * y) * Float64(Float64(x * x) - Float64(y * y))) tmp = 0.0 if (y <= -1550000000.0) tmp = t_0; elseif (y <= 4.1e-39) tmp = Float64(x * Float64(x * Float64(x * x))); elseif (y <= 1.3e+154) tmp = t_0; else tmp = Float64(y * Float64(y * Float64(0.0 - Float64(y * y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * y) * ((x * x) - (y * y)); tmp = 0.0; if (y <= -1550000000.0) tmp = t_0; elseif (y <= 4.1e-39) tmp = x * (x * (x * x)); elseif (y <= 1.3e+154) tmp = t_0; else tmp = y * (y * (0.0 - (y * y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1550000000.0], t$95$0, If[LessEqual[y, 4.1e-39], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+154], t$95$0, N[(y * N[(y * N[(0.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\
\mathbf{if}\;y \leq -1550000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-39}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -1.55e9 or 4.1e-39 < y < 1.29999999999999994e154Initial program 71.4%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr92.6%
Taylor expanded in y around inf
unpow2N/A
*-lowering-*.f6486.6%
Simplified86.6%
if -1.55e9 < y < 4.1e-39Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
+-lft-identityN/A
unpow2N/A
mul0-lftN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-+r+N/A
+-commutativeN/A
associate-*l*N/A
+-commutativeN/A
associate-+r+N/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
Simplified94.1%
if 1.29999999999999994e154 < y Initial program 53.3%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr66.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6466.7%
Simplified66.7%
Taylor expanded in x around 0
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6486.7%
Simplified86.7%
Final simplification90.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y (- 0.0 (* y y))))))
(if (<= y -500000000000.0)
t_0
(if (<= y 1.15e-30) (* x (* x (* x x))) t_0))))
double code(double x, double y) {
double t_0 = y * (y * (0.0 - (y * y)));
double tmp;
if (y <= -500000000000.0) {
tmp = t_0;
} else if (y <= 1.15e-30) {
tmp = x * (x * (x * x));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y * (y * (0.0d0 - (y * y)))
if (y <= (-500000000000.0d0)) then
tmp = t_0
else if (y <= 1.15d-30) then
tmp = x * (x * (x * x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * (0.0 - (y * y)));
double tmp;
if (y <= -500000000000.0) {
tmp = t_0;
} else if (y <= 1.15e-30) {
tmp = x * (x * (x * x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * (y * (0.0 - (y * y))) tmp = 0 if y <= -500000000000.0: tmp = t_0 elif y <= 1.15e-30: tmp = x * (x * (x * x)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * Float64(y * Float64(0.0 - Float64(y * y)))) tmp = 0.0 if (y <= -500000000000.0) tmp = t_0; elseif (y <= 1.15e-30) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * (0.0 - (y * y))); tmp = 0.0; if (y <= -500000000000.0) tmp = t_0; elseif (y <= 1.15e-30) tmp = x * (x * (x * x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(0.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -500000000000.0], t$95$0, If[LessEqual[y, 1.15e-30], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\
\mathbf{if}\;y \leq -500000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -5e11 or 1.14999999999999992e-30 < y Initial program 66.9%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr86.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.4%
Simplified86.4%
Taylor expanded in x around 0
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6473.2%
Simplified73.2%
if -5e11 < y < 1.14999999999999992e-30Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
+-lft-identityN/A
unpow2N/A
mul0-lftN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-+r+N/A
+-commutativeN/A
associate-*l*N/A
+-commutativeN/A
associate-+r+N/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
Simplified94.1%
(FPCore (x y) :precision binary64 (* x (* x (* x x))))
double code(double x, double y) {
return x * (x * (x * x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (x * (x * x))
end function
public static double code(double x, double y) {
return x * (x * (x * x));
}
def code(x, y): return x * (x * (x * x))
function code(x, y) return Float64(x * Float64(x * Float64(x * x))) end
function tmp = code(x, y) tmp = x * (x * (x * x)); end
code[x_, y_] := N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(x \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 83.6%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
metadata-evalN/A
unpow2N/A
fmm-defN/A
metadata-evalN/A
unpow2N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr93.1%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
+-lft-identityN/A
unpow2N/A
mul0-lftN/A
metadata-evalN/A
distribute-lft1-inN/A
associate-+r+N/A
+-commutativeN/A
associate-*l*N/A
+-commutativeN/A
associate-+r+N/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
Simplified61.1%
herbie shell --seed 2024141
(FPCore (x y)
:name "Radioactive exchange between two surfaces"
:precision binary64
(- (pow x 4.0) (pow y 4.0)))